From 1914cc13b48051d40b668cc4d0d089bdf92be85c Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Fri, 26 Nov 2021 12:24:37 +0100 Subject: [PATCH] check that static ArrayExtents and One mapping are stateless --- include/llama/ArrayExtents.hpp | 1 + tests/virtualrecord.cpp | 7 +------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/llama/ArrayExtents.hpp b/include/llama/ArrayExtents.hpp index 5e3431decb..33cfe6216e 100644 --- a/include/llama/ArrayExtents.hpp +++ b/include/llama/ArrayExtents.hpp @@ -126,6 +126,7 @@ namespace llama static_assert(std::is_trivially_move_constructible_v>); static_assert(std::is_trivially_copy_assignable_v>); static_assert(std::is_trivially_move_assignable_v>); + static_assert(std::is_empty_v>); template LLAMA_FN_HOST_ACC_INLINE constexpr auto operator==(ArrayExtents a, ArrayExtents b) -> bool diff --git a/tests/virtualrecord.cpp b/tests/virtualrecord.cpp index 8a7a361163..bff7fa1610 100644 --- a/tests/virtualrecord.cpp +++ b/tests/virtualrecord.cpp @@ -962,12 +962,7 @@ TEST_CASE("VirtualRecord.One.size") { using Mapping = llama::mapping::MinAlignedOne, Particle>; STATIC_REQUIRE(Mapping{}.blobSize(0) == 56); - - struct S : Mapping::ArrayIndex - { - char c; - }; - STATIC_REQUIRE(sizeof(S) == sizeof(char)); + STATIC_REQUIRE(std::is_empty_v); [[maybe_unused]] const auto v = llama::allocViewStack<0, Particle>(); STATIC_REQUIRE(std::is_same_v);