Browse Source

test: drop a bunch of NOLINT

Michele Caini 2 years ago
parent
commit
1dbeedcf12

+ 87 - 112
test/entt/entity/group.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <array>
 #include <cstddef>
 #include <functional>
 #include <iterator>
@@ -23,7 +24,7 @@ TEST(NonOwningGroup, Functionalities) {
     registry.emplace<char>(e0, '1');
 
     const auto e1 = registry.create();
-    registry.emplace<int>(e1, 42); // NOLINT
+    registry.emplace<int>(e1, 4);
     registry.emplace<char>(e1, '2');
 
     ASSERT_FALSE(group.empty());
@@ -47,7 +48,7 @@ TEST(NonOwningGroup, Functionalities) {
     ASSERT_EQ(group.size(), 1u);
 
     for(auto entity: group) {
-        ASSERT_EQ(std::get<0>(cgroup.get<const int, const char>(entity)), 42);
+        ASSERT_EQ(std::get<0>(cgroup.get<const int, const char>(entity)), 4);
         ASSERT_EQ(std::get<1>(group.get<int, char>(entity)), '2');
         ASSERT_EQ(cgroup.get<1>(entity), '2');
     }
@@ -175,7 +176,7 @@ TEST(NonOwningGroup, Empty) {
 
 TEST(NonOwningGroup, Each) {
     entt::registry registry;
-    const entt::entity entity[2]{registry.create(), registry.create()}; // NOLINT
+    std::array entity{registry.create(), registry.create()};
 
     auto group = registry.group(entt::get<int, char>);
     auto cgroup = std::as_const(registry).group_if_exists(entt::get<const int, const char>);
@@ -347,7 +348,7 @@ TEST(NonOwningGroup, IndexRebuiltOnDestroy) {
     registry.emplace<int>(e1, 1);
 
     registry.destroy(e0);
-    registry.emplace<int>(registry.create(), 42); // NOLINT
+    registry.emplace<int>(registry.create(), 4);
 
     ASSERT_EQ(group.size(), 1u);
     ASSERT_EQ(group[{}], e1);
@@ -643,12 +644,12 @@ TEST(NonOwningGroup, ExtendedGet) {
     entt::registry registry;
     const auto entity = registry.create();
 
-    registry.emplace<int>(entity, 42); // NOLINT
+    registry.emplace<int>(entity, 3);
     registry.emplace<char>(entity, 'c');
 
     const auto tup = registry.group(entt::get<int, char>).get(entity);
 
-    ASSERT_EQ(std::get<0>(tup), 42);
+    ASSERT_EQ(std::get<0>(tup), 3);
     ASSERT_EQ(std::get<1>(tup), 'c');
 }
 
@@ -754,7 +755,7 @@ TEST(NonOwningGroup, Overlapping) {
     ASSERT_FALSE(group.empty());
     ASSERT_TRUE(other.empty());
 
-    registry.emplace<int>(entity, 42); // NOLINT
+    registry.emplace<int>(entity, 2);
 
     ASSERT_FALSE(group.empty());
     ASSERT_FALSE(other.empty());
@@ -776,7 +777,7 @@ TEST(OwningGroup, Functionalities) {
     registry.emplace<char>(e0, '1');
 
     const auto e1 = registry.create();
-    registry.emplace<int>(e1, 42); // NOLINT
+    registry.emplace<int>(e1, 4);
     registry.emplace<char>(e1, '2');
 
     ASSERT_FALSE(group.empty());
@@ -799,17 +800,17 @@ TEST(OwningGroup, Functionalities) {
 
     ASSERT_EQ(group.size(), 1u);
 
-    ASSERT_EQ(cgroup.storage<const int>()->raw()[0u][0u], 42);
-    ASSERT_EQ(group.storage<int>()->raw()[0u][0u], 42);
+    ASSERT_EQ(cgroup.storage<const int>()->raw()[0u][0u], 4);
+    ASSERT_EQ(group.storage<int>()->raw()[0u][0u], 4);
 
     for(auto entity: group) {
-        ASSERT_EQ(std::get<0>(cgroup.get<const int, const char>(entity)), 42);
+        ASSERT_EQ(std::get<0>(cgroup.get<const int, const char>(entity)), 4);
         ASSERT_EQ(std::get<1>(group.get<int, char>(entity)), '2');
         ASSERT_EQ(cgroup.get<1>(entity), '2');
     }
 
     ASSERT_EQ(group.handle().data()[0u], e1);
-    ASSERT_EQ(group.storage<int>()->raw()[0u][0u], 42);
+    ASSERT_EQ(group.storage<int>()->raw()[0u][0u], 4);
 
     registry.erase<char>(e0);
     registry.erase<char>(e1);
@@ -924,7 +925,7 @@ TEST(OwningGroup, Empty) {
 
 TEST(OwningGroup, Each) {
     entt::registry registry;
-    const entt::entity entity[2]{registry.create(), registry.create()}; // NOLINT
+    std::array entity{registry.create(), registry.create()};
 
     auto group = registry.group<int>(entt::get<char>);
     auto cgroup = std::as_const(registry).group_if_exists<const int>(entt::get<const char>);
@@ -977,21 +978,15 @@ TEST(OwningGroup, Each) {
 TEST(OwningGroup, SortOrdered) {
     entt::registry registry;
     auto group = registry.group<test::boxed_int, char>();
+    constexpr auto number_of_entities = 5u;
 
-    entt::entity entity[5]{}; // NOLINT
-    registry.create(std::begin(entity), std::end(entity));
-
-    registry.emplace<test::boxed_int>(entity[0], 12); // NOLINT
-    registry.emplace<char>(entity[0], 'a');
-
-    registry.emplace<test::boxed_int>(entity[1], 9); // NOLINT
-    registry.emplace<char>(entity[1], 'b');
-
-    registry.emplace<test::boxed_int>(entity[2], 6); // NOLINT
-    registry.emplace<char>(entity[2], 'c');
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<test::boxed_int, number_of_entities> value{16, 8, 4, 1, 2};
+    const std::array other{'a', 'b', 'c'};
 
-    registry.emplace<test::boxed_int>(entity[3], 1);
-    registry.emplace<test::boxed_int>(entity[4], 2);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::boxed_int>(entity.begin(), entity.end(), value.begin());
+    registry.insert<char>(entity.begin(), entity.begin() + other.size(), other.begin());
 
     group.sort([&group](const entt::entity lhs, const entt::entity rhs) {
         return group.get<test::boxed_int>(lhs).value < group.get<0>(rhs).value;
@@ -1003,19 +998,19 @@ TEST(OwningGroup, SortOrdered) {
     ASSERT_EQ(group.handle().data()[3u], entity[3]);
     ASSERT_EQ(group.handle().data()[4u], entity[4]);
 
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u].value, 12);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u].value, 9);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u].value, 6);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u].value, 1);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u].value, 2);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u], value[0]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u], value[1]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u], value[2]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u], value[3]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u], value[4]);
 
-    ASSERT_EQ(group.storage<char>()->raw()[0u][0u], 'a');
-    ASSERT_EQ(group.storage<char>()->raw()[0u][1u], 'b');
-    ASSERT_EQ(group.storage<char>()->raw()[0u][2u], 'c');
+    ASSERT_EQ(group.storage<char>()->raw()[0u][0u], other[0]);
+    ASSERT_EQ(group.storage<char>()->raw()[0u][1u], other[1]);
+    ASSERT_EQ(group.storage<char>()->raw()[0u][2u], other[2]);
 
-    ASSERT_EQ((group.get<test::boxed_int, char>(entity[0])), (std::make_tuple(test::boxed_int{12}, 'a')));
-    ASSERT_EQ((group.get<0, 1>(entity[1])), (std::make_tuple(test::boxed_int{9}, 'b')));
-    ASSERT_EQ((group.get<test::boxed_int, char>(entity[2])), (std::make_tuple(test::boxed_int{6}, 'c')));
+    ASSERT_EQ((group.get<test::boxed_int, char>(entity[0])), (std::make_tuple(value[0], other[0])));
+    ASSERT_EQ((group.get<0, 1>(entity[1])), (std::make_tuple(value[1], other[1])));
+    ASSERT_EQ((group.get<test::boxed_int, char>(entity[2])), (std::make_tuple(value[2], other[2])));
 
     ASSERT_FALSE(group.contains(entity[3]));
     ASSERT_FALSE(group.contains(entity[4]));
@@ -1024,21 +1019,15 @@ TEST(OwningGroup, SortOrdered) {
 TEST(OwningGroup, SortReverse) {
     entt::registry registry;
     auto group = registry.group<test::boxed_int, char>();
+    constexpr auto number_of_entities = 5u;
 
-    entt::entity entity[5]{}; // NOLINT
-    registry.create(std::begin(entity), std::end(entity));
-
-    registry.emplace<test::boxed_int>(entity[0], 6); // NOLINT
-    registry.emplace<char>(entity[0], 'a');
-
-    registry.emplace<test::boxed_int>(entity[1], 9); // NOLINT
-    registry.emplace<char>(entity[1], 'b');
-
-    registry.emplace<test::boxed_int>(entity[2], 12); // NOLINT
-    registry.emplace<char>(entity[2], 'c');
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<test::boxed_int, number_of_entities> value{4, 8, 16, 1, 2};
+    const std::array other{'a', 'b', 'c'};
 
-    registry.emplace<test::boxed_int>(entity[3], 1);
-    registry.emplace<test::boxed_int>(entity[4], 2);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::boxed_int>(entity.begin(), entity.end(), value.begin());
+    registry.insert<char>(entity.begin(), entity.begin() + other.size(), other.begin());
 
     group.sort<test::boxed_int>([](const auto &lhs, const auto &rhs) {
         return lhs.value < rhs.value;
@@ -1050,19 +1039,19 @@ TEST(OwningGroup, SortReverse) {
     ASSERT_EQ(group.handle().data()[3u], entity[3]);
     ASSERT_EQ(group.handle().data()[4u], entity[4]);
 
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u].value, 12);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u].value, 9);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u].value, 6);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u].value, 1);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u].value, 2);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u], value[2]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u], value[1]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u], value[0]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u], value[3]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u], value[4]);
 
-    ASSERT_EQ(group.storage<char>()->raw()[0u][0u], 'c');
-    ASSERT_EQ(group.storage<char>()->raw()[0u][1u], 'b');
-    ASSERT_EQ(group.storage<char>()->raw()[0u][2u], 'a');
+    ASSERT_EQ(group.storage<char>()->raw()[0u][0u], other[2]);
+    ASSERT_EQ(group.storage<char>()->raw()[0u][1u], other[1]);
+    ASSERT_EQ(group.storage<char>()->raw()[0u][2u], other[0]);
 
-    ASSERT_EQ((group.get<test::boxed_int, char>(entity[0])), (std::make_tuple(test::boxed_int{6}, 'a')));
-    ASSERT_EQ((group.get<0, 1>(entity[1])), (std::make_tuple(test::boxed_int{9}, 'b')));
-    ASSERT_EQ((group.get<test::boxed_int, char>(entity[2])), (std::make_tuple(test::boxed_int{12}, 'c')));
+    ASSERT_EQ((group.get<test::boxed_int, char>(entity[0])), (std::make_tuple(value[0], other[0])));
+    ASSERT_EQ((group.get<0, 1>(entity[1])), (std::make_tuple(value[1], other[1])));
+    ASSERT_EQ((group.get<test::boxed_int, char>(entity[2])), (std::make_tuple(value[2], other[2])));
 
     ASSERT_FALSE(group.contains(entity[3]));
     ASSERT_FALSE(group.contains(entity[4]));
@@ -1071,27 +1060,15 @@ TEST(OwningGroup, SortReverse) {
 TEST(OwningGroup, SortUnordered) {
     entt::registry registry;
     auto group = registry.group<test::boxed_int>(entt::get<char>);
+    constexpr auto number_of_entities = 7u;
 
-    entt::entity entity[7]{}; // NOLINT
-    registry.create(std::begin(entity), std::end(entity));
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<test::boxed_int, number_of_entities> value{16, 2, 1, 32, 64, 4, 8};
+    const std::array other{'c', 'b', 'a', 'd', 'e'};
 
-    registry.emplace<test::boxed_int>(entity[0], 6); // NOLINT
-    registry.emplace<char>(entity[0], 'c');
-
-    registry.emplace<test::boxed_int>(entity[1], 3);
-    registry.emplace<char>(entity[1], 'b');
-
-    registry.emplace<test::boxed_int>(entity[2], 1);
-    registry.emplace<char>(entity[2], 'a');
-
-    registry.emplace<test::boxed_int>(entity[3], 9); // NOLINT
-    registry.emplace<char>(entity[3], 'd');
-
-    registry.emplace<test::boxed_int>(entity[4], 12); // NOLINT
-    registry.emplace<char>(entity[4], 'e');
-
-    registry.emplace<test::boxed_int>(entity[5], 4); // NOLINT
-    registry.emplace<test::boxed_int>(entity[6], 5); // NOLINT
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::boxed_int>(entity.begin(), entity.end(), value.begin());
+    registry.insert<char>(entity.begin(), entity.begin() + other.size(), other.begin());
 
     group.sort<test::boxed_int, char>([](const auto lhs, const auto rhs) {
         testing::StaticAssertTypeEq<decltype(std::get<0>(lhs)), test::boxed_int &>();
@@ -1107,19 +1084,19 @@ TEST(OwningGroup, SortUnordered) {
     ASSERT_EQ(group.handle().data()[5u], entity[5]);
     ASSERT_EQ(group.handle().data()[6u], entity[6]);
 
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u].value, 12);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u].value, 9);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u].value, 6);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u].value, 3);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u].value, 1);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][5u].value, 4);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][6u].value, 5);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u], value[4]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u], value[3]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u], value[0]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u], value[1]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][4u], value[2]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][5u], value[5]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][6u], value[6]);
 
-    ASSERT_EQ(group.get<char>(group.handle().data()[0u]), 'e');
-    ASSERT_EQ(group.get<1>(group.handle().data()[1u]), 'd');
-    ASSERT_EQ(group.get<char>(group.handle().data()[2u]), 'c');
-    ASSERT_EQ(group.get<1>(group.handle().data()[3u]), 'b');
-    ASSERT_EQ(group.get<char>(group.handle().data()[4u]), 'a');
+    ASSERT_EQ(group.get<char>(group.handle().data()[0u]), other[4]);
+    ASSERT_EQ(group.get<1>(group.handle().data()[1u]), other[3]);
+    ASSERT_EQ(group.get<char>(group.handle().data()[2u]), other[0]);
+    ASSERT_EQ(group.get<1>(group.handle().data()[3u]), other[1]);
+    ASSERT_EQ(group.get<char>(group.handle().data()[4u]), other[2]);
 
     ASSERT_FALSE(group.contains(entity[5]));
     ASSERT_FALSE(group.contains(entity[6]));
@@ -1128,16 +1105,13 @@ TEST(OwningGroup, SortUnordered) {
 TEST(OwningGroup, SortWithExclusionList) {
     entt::registry registry;
     auto group = registry.group<test::boxed_int>(entt::get<>, entt::exclude<char>);
+    constexpr auto number_of_entities = 5u;
 
-    entt::entity entity[5]{}; // NOLINT
-    registry.create(std::begin(entity), std::end(entity));
-
-    registry.emplace<test::boxed_int>(entity[0], 0);
-    registry.emplace<test::boxed_int>(entity[1], 1);
-    registry.emplace<test::boxed_int>(entity[2], 2);
-    registry.emplace<test::boxed_int>(entity[3], 3);
-    registry.emplace<test::boxed_int>(entity[4], 4);
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<test::boxed_int, number_of_entities> value{1, 2, 4, 8, 16};
 
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::boxed_int>(entity.begin(), entity.end(), value.begin());
     registry.emplace<char>(entity[2]);
 
     group.sort([](const entt::entity lhs, const entt::entity rhs) {
@@ -1149,15 +1123,15 @@ TEST(OwningGroup, SortWithExclusionList) {
     ASSERT_EQ(group.handle().data()[2u], entity[1]);
     ASSERT_EQ(group.handle().data()[3u], entity[0]);
 
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u].value, 4);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u].value, 3);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u].value, 1);
-    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u].value, 0);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][0u], value[4]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][1u], value[3]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][2u], value[1]);
+    ASSERT_EQ(group.storage<test::boxed_int>()->raw()[0u][3u], value[0]);
 
-    ASSERT_EQ(group.get<test::boxed_int>(entity[0]).value, 0);
-    ASSERT_EQ(group.get<0>(entity[1]).value, 1);
-    ASSERT_EQ(group.get<test::boxed_int>(entity[3]).value, 3);
-    ASSERT_EQ(group.get<0>(entity[4]).value, 4);
+    ASSERT_EQ(group.get<test::boxed_int>(entity[0]), value[0]);
+    ASSERT_EQ(group.get<0>(entity[1]), value[1]);
+    ASSERT_EQ(group.get<test::boxed_int>(entity[3]), value[3]);
+    ASSERT_EQ(group.get<0>(entity[4]), value[4]);
 
     ASSERT_FALSE(group.contains(entity[2]));
 }
@@ -1176,7 +1150,7 @@ TEST(OwningGroup, IndexRebuiltOnDestroy) {
     registry.emplace<int>(e1, 1);
 
     registry.destroy(e0);
-    registry.emplace<int>(registry.create(), 42); // NOLINT
+    registry.emplace<int>(registry.create(), 4);
 
     ASSERT_EQ(group.size(), 1u);
     ASSERT_EQ(group[{}], e1);
@@ -1475,8 +1449,9 @@ TEST(OwningGroup, SignalRace) {
 
 TEST(OwningGroup, StableLateInitialization) {
     entt::registry registry;
+    constexpr auto number_of_entities = 30u;
 
-    for(std::size_t i{}; i < 30u; ++i) { // NOLINT
+    for(std::size_t i{}; i < number_of_entities; ++i) {
         auto entity = registry.create();
         if(!(i % 2u)) registry.emplace<int>(entity);
         if(!(i % 3u)) registry.emplace<char>(entity);
@@ -1532,12 +1507,12 @@ TEST(OwningGroup, ExtendedGet) {
     entt::registry registry;
     const auto entity = registry.create();
 
-    registry.emplace<int>(entity, 42); // NOLINT
+    registry.emplace<int>(entity, 3);
     registry.emplace<char>(entity, 'c');
 
     const auto tup = registry.group<int>(entt::get<char>).get(entity);
 
-    ASSERT_EQ(std::get<0>(tup), 42);
+    ASSERT_EQ(std::get<0>(tup), 3);
     ASSERT_EQ(std::get<1>(tup), 'c');
 }
 

+ 11 - 11
test/entt/entity/handle.cpp

@@ -164,12 +164,12 @@ TEST(BasicHandle, Component) {
     ASSERT_EQ('c', handle.emplace_or_replace<char>('c'));
     ASSERT_EQ(.3, handle.emplace_or_replace<double>(.3));
 
-    const auto &patched = handle.patch<int>([](auto &comp) { comp = 42; }); // NOLINT
+    const auto &patched = handle.patch<int>([](auto &comp) { comp = 2; });
 
-    ASSERT_EQ(42, patched);
+    ASSERT_EQ(2, patched);
     ASSERT_EQ('a', handle.replace<char>('a'));
     ASSERT_TRUE((handle.all_of<int, char, double>()));
-    ASSERT_EQ((std::make_tuple(42, 'a', .3)), (handle.get<int, char, double>()));
+    ASSERT_EQ((std::make_tuple(2, 'a', .3)), (handle.get<int, char, double>()));
 
     handle.erase<char, double>();
 
@@ -190,11 +190,11 @@ TEST(BasicHandle, Component) {
     ASSERT_TRUE(registry.storage<int>().empty());
     ASSERT_TRUE(handle.orphan());
 
-    ASSERT_EQ(42, handle.get_or_emplace<int>(42));
-    ASSERT_EQ(42, handle.get_or_emplace<int>(1));
-    ASSERT_EQ(42, handle.get<int>());
+    ASSERT_EQ(2, handle.get_or_emplace<int>(2));
+    ASSERT_EQ(2, handle.get_or_emplace<int>(1));
+    ASSERT_EQ(2, handle.get<int>());
 
-    ASSERT_EQ(42, *handle.try_get<int>());
+    ASSERT_EQ(2, *handle.try_get<int>());
     ASSERT_EQ(nullptr, handle.try_get<char>());
     ASSERT_EQ(nullptr, std::get<1>(handle.try_get<int, char, double>()));
 }
@@ -205,7 +205,7 @@ TYPED_TEST(BasicHandle, FromEntity) {
     entt::registry registry;
     const auto entity = registry.create();
 
-    registry.emplace<int>(entity, 42); // NOLINT
+    registry.emplace<int>(entity, 2);
     registry.emplace<char>(entity, 'c');
 
     const handle_type handle{registry, entity};
@@ -213,7 +213,7 @@ TYPED_TEST(BasicHandle, FromEntity) {
     ASSERT_TRUE(handle);
     ASSERT_EQ(entity, handle.entity());
     ASSERT_TRUE((handle.template all_of<int, char>()));
-    ASSERT_EQ(handle.template get<int>(), 42);
+    ASSERT_EQ(handle.template get<int>(), 2);
     ASSERT_EQ(handle.template get<char>(), 'c');
 }
 
@@ -243,12 +243,12 @@ TEST(BasicHandle, ImplicitConversions) {
     const entt::handle_view<int, char> handle_view = handle;
     const entt::const_handle_view<int> const_handle_view = handle_view;
 
-    handle.emplace<int>(42); // NOLINT
+    handle.emplace<int>(2);
 
     ASSERT_EQ(handle.get<int>(), const_handle.get<int>());
     ASSERT_EQ(const_handle.get<int>(), handle_view.get<int>());
     ASSERT_EQ(handle_view.get<int>(), const_handle_view.get<int>());
-    ASSERT_EQ(const_handle_view.get<int>(), 42);
+    ASSERT_EQ(const_handle_view.get<int>(), 2);
 }
 
 TYPED_TEST(BasicHandle, Storage) {

+ 3 - 2
test/entt/entity/organizer.cpp

@@ -397,7 +397,8 @@ TEST(Organizer, Dependencies) {
     organizer.emplace<char, const double>(+[](const void *, entt::registry &) {});
 
     const auto graph = organizer.graph();
-    std::array<const entt::type_info *, 5u> buffer{}; // NOLINT
+    constexpr auto number_of_elements = 5u;
+    std::array<const entt::type_info *, number_of_elements> buffer{};
 
     ASSERT_EQ(graph.size(), 3u);
 
@@ -439,7 +440,7 @@ TEST(Organizer, ToArgsIntegrity) {
     entt::registry registry;
 
     organizer.emplace<&to_args_integrity>();
-    registry.ctx().emplace<std::size_t>(42u); // NOLINT
+    registry.ctx().emplace<std::size_t>(2u);
 
     auto graph = organizer.graph();
     graph[0u].callback()(graph[0u].data(), registry);

+ 132 - 133
test/entt/entity/registry.cpp

@@ -1,3 +1,4 @@
+#include <array>
 #include <cstddef>
 #include <cstdint>
 #include <functional>
@@ -121,17 +122,17 @@ TEST(Registry, Context) {
     ASSERT_TRUE(ctx.erase<char>());
 
     ctx.emplace<char>('c');
-    ctx.emplace<int>(42); // NOLINT
+    ctx.emplace<int>(1);
 
     ASSERT_EQ(ctx.emplace<char>('a'), 'c');
     ASSERT_EQ(ctx.find<const char>(), cctx.find<char>());
     ASSERT_EQ(ctx.get<char>(), cctx.get<const char>());
     ASSERT_EQ(ctx.get<char>(), 'c');
 
-    ASSERT_EQ(ctx.emplace<const int>(0), 42);
+    ASSERT_EQ(ctx.emplace<const int>(0), 1);
     ASSERT_EQ(ctx.find<const int>(), cctx.find<int>());
     ASSERT_EQ(ctx.get<int>(), cctx.get<const int>());
-    ASSERT_EQ(ctx.get<int>(), 42);
+    ASSERT_EQ(ctx.get<int>(), 1);
 
     ASSERT_EQ(ctx.find<double>(), nullptr);
     ASSERT_EQ(cctx.find<double>(), nullptr);
@@ -154,7 +155,7 @@ TEST(Registry, ContextHint) {
     auto &ctx = registry.ctx();
     const auto &cctx = std::as_const(registry).ctx();
 
-    ctx.emplace<int>(42); // NOLINT
+    ctx.emplace<int>(1);
     ctx.emplace_as<int>("other"_hs, 3);
 
     ASSERT_TRUE(ctx.contains<int>());
@@ -165,20 +166,20 @@ TEST(Registry, ContextHint) {
     ASSERT_NE(ctx.find<int>("other"_hs), nullptr);
     ASSERT_EQ(cctx.find<const char>("other"_hs), nullptr);
 
-    ASSERT_EQ(ctx.get<int>(), 42);
+    ASSERT_EQ(ctx.get<int>(), 1);
     ASSERT_EQ(cctx.get<const int>("other"_hs), 3);
 
     ctx.insert_or_assign(3);
-    ctx.insert_or_assign("other"_hs, 42); // NOLINT
+    ctx.insert_or_assign("other"_hs, 1);
 
     ASSERT_EQ(ctx.get<const int>(), 3);
-    ASSERT_EQ(cctx.get<int>("other"_hs), 42);
+    ASSERT_EQ(cctx.get<int>("other"_hs), 1);
 
     ASSERT_FALSE(ctx.erase<char>("other"_hs));
     ASSERT_TRUE(ctx.erase<int>());
 
     ASSERT_TRUE(cctx.contains<int>("other"_hs));
-    ASSERT_EQ(ctx.get<int>("other"_hs), 42);
+    ASSERT_EQ(ctx.get<int>("other"_hs), 1);
 
     ASSERT_TRUE(ctx.erase<int>("other"_hs));
 
@@ -195,17 +196,17 @@ TEST(Registry, ContextAsRef) {
     ASSERT_NE(registry.ctx().find<int>(), nullptr);
     ASSERT_NE(registry.ctx().find<const int>(), nullptr);
     ASSERT_NE(std::as_const(registry).ctx().find<const int>(), nullptr);
-    ASSERT_EQ(registry.ctx().get<const int>(), 3);
-    ASSERT_EQ(registry.ctx().get<int>(), 3);
+    ASSERT_EQ(registry.ctx().get<const int>(), value);
+    ASSERT_EQ(registry.ctx().get<int>(), value);
 
-    registry.ctx().get<int>() = 42; // NOLINT
+    registry.ctx().get<int>() = 2;
 
-    ASSERT_EQ(registry.ctx().get<int>(), 42);
-    ASSERT_EQ(value, 42);
+    ASSERT_EQ(value, 2);
+    ASSERT_EQ(registry.ctx().get<int>(), value);
 
-    value = 3; // NOLINT
+    value = 1;
 
-    ASSERT_EQ(std::as_const(registry).ctx().get<const int>(), 3);
+    ASSERT_EQ(std::as_const(registry).ctx().get<const int>(), value);
 }
 
 TEST(Registry, ContextAsConstRef) {
@@ -217,11 +218,11 @@ TEST(Registry, ContextAsConstRef) {
     ASSERT_EQ(registry.ctx().find<int>(), nullptr);
     ASSERT_NE(registry.ctx().find<const int>(), nullptr);
     ASSERT_NE(std::as_const(registry).ctx().find<const int>(), nullptr);
-    ASSERT_EQ(registry.ctx().get<const int>(), 3);
+    ASSERT_EQ(registry.ctx().get<const int>(), value);
 
-    value = 42; // NOLINT
+    value = 1;
 
-    ASSERT_EQ(std::as_const(registry).ctx().get<const int>(), 42);
+    ASSERT_EQ(std::as_const(registry).ctx().get<const int>(), value);
 }
 
 TEST(Registry, Functionalities) {
@@ -377,7 +378,7 @@ TEST(Registry, Functionalities) {
 
 TEST(Registry, Constructors) {
     entt::registry registry;
-    entt::registry other{42u}; // NOLINT
+    entt::registry other{64u};
 
     ASSERT_TRUE(registry.storage<entt::entity>().empty());
     ASSERT_TRUE(other.storage<entt::entity>().empty());
@@ -450,17 +451,17 @@ TEST(Registry, ReplaceAggregate) {
     const auto entity = registry.create();
 
     registry.emplace<test::aggregate>(entity, 0);
-    auto &instance = registry.replace<test::aggregate>(entity, 42); // NOLINT
+    auto &instance = registry.replace<test::aggregate>(entity, 1);
 
-    ASSERT_EQ(instance.value, 42);
+    ASSERT_EQ(instance.value, 1);
 }
 
 TEST(Registry, EmplaceOrReplaceAggregate) {
     entt::registry registry;
     const auto entity = registry.create();
-    auto &instance = registry.emplace_or_replace<test::aggregate>(entity, 42); // NOLINT
+    auto &instance = registry.emplace_or_replace<test::aggregate>(entity, 1);
 
-    ASSERT_EQ(instance.value, 42);
+    ASSERT_EQ(instance.value, 1);
 }
 
 TEST(Registry, Identifiers) {
@@ -490,14 +491,14 @@ TEST(Registry, CreateManyEntitiesAtOnce) {
     using traits_type = entt::entt_traits<entt::entity>;
 
     entt::registry registry;
-    entt::entity entity[3]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
     const auto entt = registry.create();
     registry.destroy(registry.create());
     registry.destroy(entt);
     registry.destroy(registry.create());
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     ASSERT_TRUE(registry.valid(entity[0]));
     ASSERT_TRUE(registry.valid(entity[1]));
@@ -515,23 +516,23 @@ TEST(Registry, CreateManyEntitiesAtOnce) {
 
 TEST(Registry, CreateManyEntitiesAtOnceWithListener) {
     entt::registry registry;
-    entt::entity entity[3]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
     listener listener;
 
     registry.on_construct<int>().connect<&listener::incr>(listener);
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert(std::begin(entity), std::end(entity), 42); // NOLINT
-    registry.insert(std::begin(entity), std::end(entity), 'c');
+    registry.create(entity.begin(), entity.end());
+    registry.insert(entity.begin(), entity.end(), 1);
+    registry.insert(entity.begin(), entity.end(), 'c');
 
-    ASSERT_EQ(registry.get<int>(entity[0]), 42);
+    ASSERT_EQ(registry.get<int>(entity[0]), 1);
     ASSERT_EQ(registry.get<char>(entity[1]), 'c');
     ASSERT_EQ(listener.counter, 3);
 
     registry.on_construct<int>().disconnect<&listener::incr>(listener);
     registry.on_construct<test::empty>().connect<&listener::incr>(listener);
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert(std::begin(entity), std::end(entity), 'a');
-    registry.insert<test::empty>(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
+    registry.insert(entity.begin(), entity.end(), 'a');
+    registry.insert<test::empty>(entity.begin(), entity.end());
 
     ASSERT_TRUE(registry.all_of<test::empty>(entity[0]));
     ASSERT_EQ(registry.get<char>(entity[2]), 'a');
@@ -664,9 +665,9 @@ TEST(Registry, DestroyRange) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, char>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<char>(entity[0u]);
@@ -702,15 +703,15 @@ TEST(Registry, DestroyRange) {
     ASSERT_EQ(registry.storage<char>().size(), 0u);
     ASSERT_EQ(registry.storage<double>().size(), 0u);
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end());
 
     ASSERT_TRUE(registry.valid(entity[0u]));
     ASSERT_TRUE(registry.valid(entity[1u]));
     ASSERT_TRUE(registry.valid(entity[2u]));
     ASSERT_EQ(registry.storage<int>().size(), 3u);
 
-    registry.destroy(std::begin(entity), std::end(entity));
+    registry.destroy(entity.begin(), entity.end());
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -719,8 +720,8 @@ TEST(Registry, DestroyRange) {
 
     entt::sparse_set managed{};
 
-    registry.create(std::begin(entity), std::end(entity));
-    managed.push(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
+    managed.push(entity.begin(), entity.end());
     registry.insert<int>(managed.begin(), managed.end());
 
     ASSERT_TRUE(registry.valid(managed[0u]));
@@ -740,9 +741,9 @@ TEST(Registry, StableDestroy) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, test::pointer_stable>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<test::pointer_stable>(entity[0u]);
@@ -822,9 +823,9 @@ TEST(Registry, TombstoneVersion) {
 
 TEST(Registry, Orphans) {
     entt::registry registry;
-    entt::entity entity[3u]{}; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
     registry.emplace<int>(entity[0u]);
     registry.emplace<int>(entity[2u]);
 
@@ -842,14 +843,14 @@ TEST(Registry, Orphans) {
 
 TEST(Registry, View) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
     auto iview = registry.view<int>();
     auto cview = registry.view<char>();
     auto mview = registry.view<int, char>();
     auto fview = registry.view<int>(entt::exclude<char>);
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u], 0);
     registry.emplace<char>(entity[0u], 'c');
@@ -876,23 +877,23 @@ TEST(Registry, View) {
     ASSERT_EQ(std::distance(mview.begin(), mview.end()), 2);
     ASSERT_EQ(std::distance(fview.begin(), fview.end()), 1);
 
-    mview.each([&entity, first = true](auto entt, auto &&...) mutable { // NOLINT
-        ASSERT_EQ(entt, entity[2u * first]);                            // NOLINT
+    mview.each([&entity, first = true](auto entt, auto &&...) mutable {
+        ASSERT_EQ(entt, entity[2u * first]); // NOLINT
         first = false;
     });
 
-    fview.each([&entity](auto entt, auto &&...) { // NOLINT
+    fview.each([&entity](auto entt, auto &&...) {
         ASSERT_EQ(entt, entity[1u]);
     });
 }
 
 TEST(Registry, ExcludeOnlyView) {
     entt::registry registry;
-    entt::entity entity[4u]; // NOLINT
+    std::array<entt::entity, 4u> entity{};
 
     auto view = registry.view<entt::entity>(entt::exclude<int>);
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u], 0);
     registry.emplace<int>(entity[2u], 0);
@@ -910,17 +911,17 @@ TEST(Registry, ExcludeOnlyView) {
         ASSERT_EQ(entt, entity[1u]);
     }
 
-    view.each([&entity](auto entt) { // NOLINT
+    view.each([&entity](auto entt) {
         ASSERT_EQ(entt, entity[1u]);
     });
 }
 
 TEST(Registry, NonOwningGroupInitOnFirstUse) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -934,11 +935,11 @@ TEST(Registry, NonOwningGroupInitOnFirstUse) {
 
 TEST(Registry, NonOwningGroupInitOnEmplace) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
     auto group = registry.group(entt::get<int, char>);
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -951,10 +952,10 @@ TEST(Registry, NonOwningGroupInitOnEmplace) {
 
 TEST(Registry, FullOwningGroupInitOnFirstUse) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -970,11 +971,11 @@ TEST(Registry, FullOwningGroupInitOnFirstUse) {
 
 TEST(Registry, FullOwningGroupInitOnEmplace) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
     auto group = registry.group<int, char>();
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -989,10 +990,10 @@ TEST(Registry, FullOwningGroupInitOnEmplace) {
 
 TEST(Registry, PartialOwningGroupInitOnFirstUse) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -1008,11 +1009,11 @@ TEST(Registry, PartialOwningGroupInitOnFirstUse) {
 
 TEST(Registry, PartialOwningGroupInitOnEmplace) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
     auto group = registry.group<int>(entt::get<char>);
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), 0);
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), 0);
     registry.emplace<char>(entity[0u], 'c');
     registry.emplace<char>(entity[2u], 'c');
 
@@ -1238,7 +1239,7 @@ TEST(Registry, ComponentsWithTypesFromStandardTemplateLibrary) {
     // see #37 - the test shouldn't crash, that's all
     entt::registry registry;
     const auto entity = registry.create();
-    registry.emplace<std::unordered_set<int>>(entity).insert(42); // NOLINT
+    registry.emplace<std::unordered_set<int>>(entity).insert(1);
     registry.destroy(entity);
 }
 
@@ -1251,7 +1252,7 @@ TEST(Registry, ConstructWithComponents) {
 
 TEST(Registry, Signals) {
     entt::registry registry;
-    entt::entity entity[2u]; // NOLINT
+    std::array<entt::entity, 2u> entity{};
     listener listener;
 
     registry.on_construct<test::empty>().connect<&listener::incr>(listener);
@@ -1259,13 +1260,13 @@ TEST(Registry, Signals) {
     registry.on_construct<int>().connect<&listener::incr>(listener);
     registry.on_destroy<int>().connect<&listener::decr>(listener);
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<test::empty>(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::empty>(entity.begin(), entity.end());
 
     ASSERT_EQ(listener.counter, 2);
     ASSERT_EQ(listener.last, entity[1u]);
 
-    registry.insert<int>(std::rbegin(entity), std::rend(entity));
+    registry.insert<int>(entity.rbegin(), entity.rend());
 
     ASSERT_EQ(listener.counter, 4);
     ASSERT_EQ(listener.last, entity[0u]);
@@ -1315,8 +1316,8 @@ TEST(Registry, Signals) {
     ASSERT_EQ(listener.counter, 0);
     ASSERT_EQ(listener.last, entity[0u]);
 
-    registry.insert<test::empty>(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity));
+    registry.insert<test::empty>(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end());
     registry.destroy(entity[1u]);
 
     ASSERT_EQ(listener.counter, 2);
@@ -1453,9 +1454,9 @@ TEST(Registry, SignalWhenDestroying) {
 
 TEST(Registry, Insert) {
     entt::registry registry;
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<char>(entity[0u]);
@@ -1478,10 +1479,10 @@ TEST(Registry, Insert) {
     ASSERT_FALSE(registry.all_of<float>(entity[2u]));
 
     registry.clear<float>();
-    float value[3]{0.f, 1.f, 2.f}; // NOLINT
+    std::array value{0.f, 1.f, 2.f};
 
     const auto iview = registry.view<int>();
-    registry.insert<float>(iview.rbegin(), iview.rend(), value); // NOLINT
+    registry.insert<float>(iview.rbegin(), iview.rend(), value.begin());
 
     ASSERT_EQ(registry.get<float>(entity[0u]), 0.f);
     ASSERT_EQ(registry.get<float>(entity[1u]), 1.f);
@@ -1492,9 +1493,9 @@ TEST(Registry, Erase) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, char>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<char>(entity[0u]);
@@ -1529,8 +1530,8 @@ TEST(Registry, Erase) {
     ASSERT_EQ(registry.storage<char>().size(), 0u);
     ASSERT_EQ(registry.storage<double>().size(), 1u);
 
-    registry.insert<int>(std::begin(entity) + 1, std::end(entity) - 1u);  // NOLINT
-    registry.insert<char>(std::begin(entity) + 1, std::end(entity) - 1u); // NOLINT
+    registry.insert<int>(entity.begin() + 1u, entity.end() - 1u);
+    registry.insert<char>(entity.begin() + 1u, entity.end() - 1u);
 
     ASSERT_EQ(registry.storage<int>().size(), 1u);
     ASSERT_EQ(registry.storage<char>().size(), 1u);
@@ -1540,13 +1541,13 @@ TEST(Registry, Erase) {
     ASSERT_EQ(registry.storage<int>().size(), 0u);
     ASSERT_EQ(registry.storage<char>().size(), 0u);
 
-    registry.insert<int>(std::begin(entity), std::end(entity));
-    registry.insert<char>(std::begin(entity), std::end(entity));
+    registry.insert<int>(entity.begin(), entity.end());
+    registry.insert<char>(entity.begin(), entity.end());
 
     ASSERT_EQ(registry.storage<int>().size(), 3u);
     ASSERT_EQ(registry.storage<char>().size(), 3u);
 
-    registry.erase<int, char>(std::begin(entity), std::end(entity));
+    registry.erase<int, char>(entity.begin(), entity.end());
 
     ASSERT_EQ(registry.storage<int>().size(), 0u);
     ASSERT_EQ(registry.storage<char>().size(), 0u);
@@ -1558,10 +1559,10 @@ TEST(Registry, Erase) {
 
 ENTT_DEBUG_TEST(RegistryDeathTest, Erase) {
     entt::registry registry;
-    const entt::entity entity[1u]{registry.create()}; // NOLINT
+    const std::array entity{registry.create()};
 
     ASSERT_FALSE((registry.any_of<int>(entity[0u])));
-    ASSERT_DEATH((registry.erase<int>(std::begin(entity), std::end(entity))), "");
+    ASSERT_DEATH((registry.erase<int>(entity.begin(), entity.end())), "");
     ASSERT_DEATH(registry.erase<int>(entity[0u]), "");
 }
 
@@ -1569,9 +1570,9 @@ TEST(Registry, StableErase) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, test::pointer_stable>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<test::pointer_stable>(entity[0u]);
@@ -1644,9 +1645,9 @@ TEST(Registry, Remove) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, char>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<char>(entity[0u]);
@@ -1686,8 +1687,8 @@ TEST(Registry, Remove) {
     ASSERT_EQ(registry.storage<char>().size(), 0u);
     ASSERT_EQ(registry.storage<double>().size(), 1u);
 
-    registry.insert<int>(std::begin(entity) + 1, std::end(entity) - 1u);  // NOLINT
-    registry.insert<char>(std::begin(entity) + 1, std::end(entity) - 1u); // NOLINT
+    registry.insert<int>(entity.begin() + 1u, entity.end() - 1u);
+    registry.insert<char>(entity.begin() + 1u, entity.end() - 1u);
 
     ASSERT_EQ(registry.storage<int>().size(), 1u);
     ASSERT_EQ(registry.storage<char>().size(), 1u);
@@ -1698,14 +1699,14 @@ TEST(Registry, Remove) {
     ASSERT_EQ(registry.storage<int>().size(), 0u);
     ASSERT_EQ(registry.storage<char>().size(), 0u);
 
-    registry.insert<int>(std::begin(entity), std::end(entity));
-    registry.insert<char>(std::begin(entity), std::end(entity));
+    registry.insert<int>(entity.begin(), entity.end());
+    registry.insert<char>(entity.begin(), entity.end());
 
     ASSERT_EQ(registry.storage<int>().size(), 3u);
     ASSERT_EQ(registry.storage<char>().size(), 3u);
 
-    registry.remove<int, char>(std::begin(entity), std::end(entity));
-    registry.remove<int, char>(std::begin(entity), std::end(entity));
+    registry.remove<int, char>(entity.begin(), entity.end());
+    registry.remove<int, char>(entity.begin(), entity.end());
 
     ASSERT_EQ(registry.storage<int>().size(), 0u);
     ASSERT_EQ(registry.storage<char>().size(), 0u);
@@ -1719,9 +1720,9 @@ TEST(Registry, StableRemove) {
     entt::registry registry;
     const auto iview = registry.view<int>();
     const auto icview = registry.view<int, test::pointer_stable>();
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, 3u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<test::pointer_stable>(entity[0u]);
@@ -1763,9 +1764,9 @@ TEST(Registry, StableRemove) {
 
 TEST(Registry, Compact) {
     entt::registry registry;
-    entt::entity entity[2u]; // NOLINT
+    std::array<entt::entity, 2u> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<test::pointer_stable>(entity[0u]);
@@ -1776,7 +1777,7 @@ TEST(Registry, Compact) {
     ASSERT_EQ(registry.storage<int>().size(), 2u);
     ASSERT_EQ(registry.storage<test::pointer_stable>().size(), 2u);
 
-    registry.destroy(std::begin(entity), std::end(entity));
+    registry.destroy(entity.begin(), entity.end());
 
     ASSERT_EQ(registry.storage<int>().size(), 0u);
     ASSERT_EQ(registry.storage<test::pointer_stable>().size(), 2u);
@@ -1915,38 +1916,36 @@ TEST(Registry, TryGet) {
 }
 
 TEST(Registry, Constness) {
-    entt::registry registry; // NOLINT
-
-    testing::StaticAssertTypeEq<decltype(registry.emplace<int>({})), int &>();
-    testing::StaticAssertTypeEq<decltype(registry.emplace<test::empty>({})), void>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().emplace<int>({})), int &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().emplace<test::empty>({})), void>();
 
-    testing::StaticAssertTypeEq<decltype(registry.get<>({})), std::tuple<>>();
-    testing::StaticAssertTypeEq<decltype(registry.get<int>({})), int &>();
-    testing::StaticAssertTypeEq<decltype(registry.get<int, const char>({})), std::tuple<int &, const char &>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().get<>({})), std::tuple<>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().get<int>({})), int &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().get<int, const char>({})), std::tuple<int &, const char &>>();
 
-    testing::StaticAssertTypeEq<decltype(registry.try_get<>({})), std::tuple<>>();
-    testing::StaticAssertTypeEq<decltype(registry.try_get<int>({})), int *>();
-    testing::StaticAssertTypeEq<decltype(registry.try_get<int, const char>({})), std::tuple<int *, const char *>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().try_get<>({})), std::tuple<>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().try_get<int>({})), int *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().try_get<int, const char>({})), std::tuple<int *, const char *>>();
 
-    testing::StaticAssertTypeEq<decltype(registry.ctx().get<int>()), int &>();
-    testing::StaticAssertTypeEq<decltype(registry.ctx().get<const char>()), const char &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().ctx().get<int>()), int &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().ctx().get<const char>()), const char &>();
 
-    testing::StaticAssertTypeEq<decltype(registry.ctx().find<int>()), int *>();
-    testing::StaticAssertTypeEq<decltype(registry.ctx().find<const char>()), const char *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().ctx().find<int>()), int *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<entt::registry>().ctx().find<const char>()), const char *>();
 
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).get<>({})), std::tuple<>>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).get<int>({})), const int &>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).get<int, const char>({})), std::tuple<const int &, const char &>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().get<>({})), std::tuple<>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().get<int>({})), const int &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().get<int, const char>({})), std::tuple<const int &, const char &>>();
 
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).try_get<>({})), std::tuple<>>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).try_get<int>({})), const int *>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).try_get<int, const char>({})), std::tuple<const int *, const char *>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().try_get<>({})), std::tuple<>>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().try_get<int>({})), const int *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().try_get<int, const char>({})), std::tuple<const int *, const char *>>();
 
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).ctx().get<int>()), const int &>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).ctx().get<const char>()), const char &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().ctx().get<int>()), const int &>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().ctx().get<const char>()), const char &>();
 
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).ctx().find<int>()), const int *>();
-    testing::StaticAssertTypeEq<decltype(std::as_const(registry).ctx().find<const char>()), const char *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().ctx().find<int>()), const int *>();
+    testing::StaticAssertTypeEq<decltype(std::declval<const entt::registry>().ctx().find<const char>()), const char *>();
 }
 
 TEST(Registry, MoveOnlyComponent) {
@@ -1958,7 +1957,7 @@ TEST(Registry, MoveOnlyComponent) {
 TEST(Registry, NonDefaultConstructibleComponent) {
     entt::registry registry;
     // the purpose is to ensure that non default constructible type are always accepted
-    registry.emplace<test::non_default_constructible>(registry.create(), 42); // NOLINT
+    registry.emplace<test::non_default_constructible>(registry.create(), 1);
 }
 
 TEST(Registry, Dependencies) {
@@ -2005,8 +2004,8 @@ TEST(Registry, AssignEntities) {
     using traits_type = entt::entt_traits<entt::entity>;
 
     entt::registry registry;
-    entt::entity entity[3]; // NOLINT
-    registry.create(std::begin(entity), std::end(entity));
+    std::array<entt::entity, 3u> entity{};
+    registry.create(entity.begin(), entity.end());
     registry.destroy(entity[1]);
     registry.destroy(entity[2]);
 
@@ -2275,7 +2274,7 @@ TEST(Registry, NoEtoType) {
     const auto entity = registry.create();
 
     registry.emplace<no_eto_type>(entity);
-    registry.emplace<int>(entity, 42); // NOLINT
+    registry.emplace<int>(entity, 1);
 
     ASSERT_NE(registry.storage<no_eto_type>().raw(), nullptr);
     ASSERT_NE(registry.try_get<no_eto_type>(entity), nullptr);

+ 3 - 3
test/entt/entity/runtime_view.cpp

@@ -59,10 +59,10 @@ TYPED_TEST(RuntimeView, Functionalities) {
 
     registry.get<char>(e0) = '1';
     registry.get<char>(e1) = '2';
-    registry.get<int>(e1) = 42; // NOLINT
+    registry.get<int>(e1) = 3;
 
     for(auto entity: view) {
-        ASSERT_EQ(registry.get<int>(entity), 42);
+        ASSERT_EQ(registry.get<int>(entity), 3);
         ASSERT_EQ(registry.get<char>(entity), '2');
     }
 
@@ -375,7 +375,7 @@ TYPED_TEST(RuntimeView, StableTypeWithExcludedComponent) {
     const auto other = registry.create();
 
     registry.emplace<test::pointer_stable>(entity, 0);
-    registry.emplace<test::pointer_stable>(other, 42); // NOLINT
+    registry.emplace<test::pointer_stable>(other, 1);
     registry.emplace<int>(entity);
 
     view.iterate(registry.storage<test::pointer_stable>()).exclude(registry.storage<int>());

+ 41 - 40
test/entt/entity/sigh_mixin.cpp

@@ -1,3 +1,4 @@
+#include <array>
 #include <cstddef>
 #include <iterator>
 #include <memory>
@@ -39,7 +40,7 @@ using SighMixinTypes = ::testing::Types<int, test::pointer_stable>;
 TYPED_TEST_SUITE(SighMixin, SighMixinTypes, );
 
 TEST(SighMixin, GenericType) {
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
     entt::sigh_mixin<entt::storage<int>> pool;
     entt::registry registry;
 
@@ -50,7 +51,7 @@ TEST(SighMixin, GenericType) {
 
     ASSERT_EQ(pool.size(), 0u);
 
-    pool.insert(entity, entity + 1u); // NOLINT
+    pool.insert(entity.begin(), entity.begin() + 1u);
     pool.erase(entity[0u]);
 
     ASSERT_EQ(pool.size(), 0u);
@@ -72,13 +73,13 @@ TEST(SighMixin, GenericType) {
     ASSERT_EQ(pool.get(entity[0u]), 0);
     ASSERT_EQ(pool.get(entity[1u]), 0);
 
-    pool.erase(std::begin(entity), std::end(entity));
+    pool.erase(entity.begin(), entity.end());
 
     ASSERT_EQ(on_construct, 2u);
     ASSERT_EQ(on_destroy, 2u);
     ASSERT_EQ(pool.size(), 0u);
 
-    ASSERT_NE(pool.push(std::begin(entity), std::end(entity)), pool.entt::sparse_set::end());
+    ASSERT_NE(pool.push(entity.begin(), entity.end()), pool.entt::sparse_set::end());
 
     ASSERT_EQ(pool.get(entity[0u]), 0);
     ASSERT_EQ(pool.get(entity[1u]), 0);
@@ -96,7 +97,7 @@ TEST(SighMixin, GenericType) {
     ASSERT_EQ(on_destroy, 4u);
     ASSERT_EQ(pool.size(), 0u);
 
-    pool.insert(std::begin(entity), std::end(entity), 3);
+    pool.insert(entity.begin(), entity.end(), 3);
 
     ASSERT_EQ(on_construct, 6u);
     ASSERT_EQ(on_destroy, 4u);
@@ -113,7 +114,7 @@ TEST(SighMixin, GenericType) {
 }
 
 TEST(SighMixin, StableType) {
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
     entt::sigh_mixin<entt::storage<test::pointer_stable>> pool;
     entt::registry registry;
 
@@ -135,13 +136,13 @@ TEST(SighMixin, StableType) {
     ASSERT_EQ(pool.get(entity[0u]).value, 0);
     ASSERT_EQ(pool.get(entity[1u]).value, 0);
 
-    pool.erase(std::begin(entity), std::end(entity));
+    pool.erase(entity.begin(), entity.end());
 
     ASSERT_EQ(on_construct, 2u);
     ASSERT_EQ(on_destroy, 2u);
     ASSERT_EQ(pool.size(), 2u);
 
-    ASSERT_NE(pool.push(std::begin(entity), std::end(entity)), pool.entt::sparse_set::end());
+    ASSERT_NE(pool.push(entity.begin(), entity.end()), pool.entt::sparse_set::end());
 
     ASSERT_EQ(pool.get(entity[0u]).value, 0);
     ASSERT_EQ(pool.get(entity[1u]).value, 0);
@@ -159,7 +160,7 @@ TEST(SighMixin, StableType) {
     ASSERT_EQ(on_destroy, 4u);
     ASSERT_EQ(pool.size(), 4u);
 
-    pool.insert(std::begin(entity), std::end(entity), test::pointer_stable{3});
+    pool.insert(entity.begin(), entity.end(), test::pointer_stable{3});
 
     ASSERT_EQ(on_construct, 6u);
     ASSERT_EQ(on_destroy, 4u);
@@ -176,7 +177,7 @@ TEST(SighMixin, StableType) {
 }
 
 TEST(SighMixin, NonDefaultConstructibleType) {
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
     entt::sigh_mixin<entt::storage<test::non_default_constructible>> pool;
     entt::registry registry;
 
@@ -204,13 +205,13 @@ TEST(SighMixin, NonDefaultConstructibleType) {
     ASSERT_EQ(on_destroy, 1u);
     ASSERT_EQ(pool.size(), 0u);
 
-    ASSERT_EQ(pool.push(std::begin(entity), std::end(entity)), pool.entt::sparse_set::end());
+    ASSERT_EQ(pool.push(entity.begin(), entity.end()), pool.entt::sparse_set::end());
 
     ASSERT_FALSE(pool.contains(entity[0u]));
     ASSERT_FALSE(pool.contains(entity[1u]));
     ASSERT_EQ(pool.size(), 0u);
 
-    pool.insert(std::begin(entity), std::end(entity), 3);
+    pool.insert(entity.begin(), entity.end(), 3);
 
     ASSERT_EQ(on_construct, 3u);
     ASSERT_EQ(on_destroy, 1u);
@@ -219,7 +220,7 @@ TEST(SighMixin, NonDefaultConstructibleType) {
     ASSERT_EQ(pool.get(entity[0u]).value, 3);
     ASSERT_EQ(pool.get(entity[1u]).value, 3);
 
-    pool.erase(std::begin(entity), std::end(entity));
+    pool.erase(entity.begin(), entity.end());
 
     ASSERT_EQ(on_construct, 3u);
     ASSERT_EQ(on_destroy, 3u);
@@ -237,20 +238,20 @@ TEST(SighMixin, VoidType) {
     pool.on_construct().connect<&listener<entt::registry>>(on_construct);
     pool.on_destroy().connect<&listener<entt::registry>>(on_destroy);
 
-    pool.emplace(entt::entity{99}); // NOLINT
+    pool.emplace(entt::entity{3});
 
     ASSERT_EQ(pool.type(), entt::type_id<void>());
-    ASSERT_TRUE(pool.contains(entt::entity{99}));
+    ASSERT_TRUE(pool.contains(entt::entity{3}));
 
     entt::sigh_mixin<entt::storage<void>> other{std::move(pool)};
 
-    ASSERT_FALSE(pool.contains(entt::entity{99})); // NOLINT
-    ASSERT_TRUE(other.contains(entt::entity{99}));
+    ASSERT_FALSE(pool.contains(entt::entity{3})); // NOLINT
+    ASSERT_TRUE(other.contains(entt::entity{3}));
 
     pool = std::move(other);
 
-    ASSERT_TRUE(pool.contains(entt::entity{99}));
-    ASSERT_FALSE(other.contains(entt::entity{99})); // NOLINT
+    ASSERT_TRUE(pool.contains(entt::entity{3}));
+    ASSERT_FALSE(other.contains(entt::entity{3})); // NOLINT
 
     pool.clear();
 
@@ -308,8 +309,8 @@ TEST(SighMixin, StorageEntity) {
     pool.emplace();
     pool.emplace(entt::entity{0});
 
-    entt::entity entity[1u]{};        // NOLINT
-    pool.insert(entity, entity + 1u); // NOLINT
+    std::array<entt::entity, 1u> entity{};
+    pool.insert(entity.begin(), entity.end());
 
     ASSERT_EQ(on_construct, 6u);
     ASSERT_EQ(on_destroy, 3u);
@@ -362,7 +363,7 @@ TYPED_TEST(SighMixin, Move) {
     other = entt::sigh_mixin<entt::storage<value_type>>{};
     other.bind(entt::forward_as_any(registry));
 
-    other.emplace(entt::entity{42}, 42); // NOLINT
+    other.emplace(entt::entity{1}, 1);
     other = std::move(pool);
 
     ASSERT_TRUE(pool.empty()); // NOLINT
@@ -395,11 +396,11 @@ TYPED_TEST(SighMixin, Swap) {
     other.on_construct().template connect<&listener<entt::registry>>(on_construct);
     other.on_destroy().template connect<&listener<entt::registry>>(on_destroy);
 
-    pool.emplace(entt::entity{42}, 41); // NOLINT
+    pool.emplace(entt::entity{4}, 1);
 
-    other.emplace(entt::entity{9}, 8); // NOLINT
-    other.emplace(entt::entity{3}, 2);
-    other.erase(entt::entity{9}); // NOLINT
+    other.emplace(entt::entity{2}, 2);
+    other.emplace(entt::entity{1}, 3);
+    other.erase(entt::entity{2});
 
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_EQ(other.size(), 1u + traits_type::in_place_delete);
@@ -412,11 +413,11 @@ TYPED_TEST(SighMixin, Swap) {
     ASSERT_EQ(pool.size(), 1u + traits_type::in_place_delete);
     ASSERT_EQ(other.size(), 1u);
 
-    ASSERT_EQ(pool.index(entt::entity{3}), traits_type::in_place_delete);
-    ASSERT_EQ(other.index(entt::entity{42}), 0u);
+    ASSERT_EQ(pool.index(entt::entity{1}), traits_type::in_place_delete);
+    ASSERT_EQ(other.index(entt::entity{4}), 0u);
 
-    ASSERT_EQ(pool.get(entt::entity{3}), value_type{2});
-    ASSERT_EQ(other.get(entt::entity{42}), value_type{41});
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{3});
+    ASSERT_EQ(other.get(entt::entity{4}), value_type{1});
 
     pool.clear();
     other.clear();
@@ -438,7 +439,7 @@ TYPED_TEST(SighMixin, CustomRegistry) {
     pool.on_destroy().template connect<&listener<custom_registry>>(on_destroy);
 
     pool.emplace(test::custom_entity{3});
-    pool.emplace(test::custom_entity{42}); // NOLINT
+    pool.emplace(test::custom_entity{1});
 
     ASSERT_EQ(on_construct, 2u);
     ASSERT_EQ(on_destroy, 0u);
@@ -557,19 +558,19 @@ TYPED_TEST(SighMixin, ThrowingAllocator) {
     ASSERT_TRUE(pool.empty());
 
     pool.emplace(entt::entity{0}, 0);
-    const entt::entity entity[2u]{entt::entity{1}, entt::entity{sparse_page_size}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{sparse_page_size}};
     pool.get_allocator().template throw_counter<entt::entity>(1u);
 
-    ASSERT_THROW(pool.insert(std::begin(entity), std::end(entity), value_type{0}), test::throwing_allocator_exception);
+    ASSERT_THROW(pool.insert(entity.begin(), entity.end(), value_type{0}), test::throwing_allocator_exception);
     ASSERT_TRUE(pool.contains(entt::entity{1}));
     ASSERT_FALSE(pool.contains(entt::entity{sparse_page_size}));
 
     pool.erase(entt::entity{1});
-    const value_type components[2u]{value_type{1}, value_type{sparse_page_size}}; // NOLINT
+    const std::array component{value_type{1}, value_type{sparse_page_size}};
     pool.get_allocator().template throw_counter<entt::entity>(0u);
     pool.compact();
 
-    ASSERT_THROW(pool.insert(std::begin(entity), std::end(entity), std::begin(components)), test::throwing_allocator_exception);
+    ASSERT_THROW(pool.insert(entity.begin(), entity.end(), component.begin()), test::throwing_allocator_exception);
     ASSERT_TRUE(pool.contains(entt::entity{1}));
     ASSERT_FALSE(pool.contains(entt::entity{sparse_page_size}));
 
@@ -589,25 +590,25 @@ TEST(SighMixin, ThrowingComponent) {
     pool.on_construct().connect<&listener<registry_type>>(on_construct);
     pool.on_destroy().connect<&listener<registry_type>>(on_destroy);
 
-    const entt::entity entity[2u]{entt::entity{42}, entt::entity{1}}; // NOLINT
-    const test::throwing_type value[2u]{true, false};                 // NOLINT
+    const std::array entity{entt::entity{3}, entt::entity{1}};
+    const std::array<test::throwing_type, 2u> value{true, false};
 
     // strong exception safety
     ASSERT_THROW(pool.emplace(entity[0u], value[0u]), test::throwing_type_exception);
     ASSERT_TRUE(pool.empty());
 
     // basic exception safety
-    ASSERT_THROW(pool.insert(std::begin(entity), std::end(entity), value[0u]), test::throwing_type_exception);
+    ASSERT_THROW(pool.insert(entity.begin(), entity.end(), value[0u]), test::throwing_type_exception);
     ASSERT_EQ(pool.size(), 0u);
     ASSERT_FALSE(pool.contains(entity[1u]));
 
     // basic exception safety
-    ASSERT_THROW(pool.insert(std::begin(entity), std::end(entity), std::begin(value)), test::throwing_type_exception);
+    ASSERT_THROW(pool.insert(entity.begin(), entity.end(), value.begin()), test::throwing_type_exception);
     ASSERT_EQ(pool.size(), 0u);
     ASSERT_FALSE(pool.contains(entity[1u]));
 
     // basic exception safety
-    ASSERT_THROW(pool.insert(std::rbegin(entity), std::rend(entity), std::rbegin(value)), test::throwing_type_exception);
+    ASSERT_THROW(pool.insert(entity.rbegin(), entity.rend(), value.rbegin()), test::throwing_type_exception);
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_TRUE(pool.contains(entity[1u]));
     ASSERT_EQ(pool.get(entity[1u]), value[1u]);

+ 62 - 57
test/entt/entity/snapshot.cpp

@@ -1,3 +1,4 @@
+#include <array>
 #include <iterator>
 #include <type_traits>
 #include <utility>
@@ -55,9 +56,10 @@ TEST(BasicSnapshot, GetEntityType) {
     ASSERT_NE(entt::any_cast<typename traits_type::entity_type>(&data[1u]), nullptr);
     ASSERT_EQ(entt::any_cast<typename traits_type::entity_type>(data[1u]), storage.free_list());
 
-    entt::entity entity[3u]; // NOLINT
+    constexpr auto number_of_entities = 3u;
+    std::array<entt::entity, number_of_entities> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
     registry.destroy(entity[1u]);
 
     data.clear();
@@ -88,12 +90,13 @@ TEST(BasicSnapshot, GetType) {
     entt::registry registry;
     const entt::basic_snapshot snapshot{registry};
     const auto &storage = registry.storage<int>();
+    constexpr auto number_of_entities = 3u;
 
-    entt::entity entity[3u];       // NOLINT
-    const int values[3u]{1, 2, 3}; // NOLINT
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<int, number_of_entities> value{1, 2, 3};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), std::begin(values));
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), value.begin());
     registry.destroy(entity[1u]);
 
     std::vector<entt::any> data{};
@@ -118,13 +121,13 @@ TEST(BasicSnapshot, GetType) {
     ASSERT_EQ(entt::any_cast<entt::entity>(data[1u]), entity[0u]);
 
     ASSERT_NE(entt::any_cast<int>(&data[2u]), nullptr);
-    ASSERT_EQ(entt::any_cast<int>(data[2u]), values[0u]);
+    ASSERT_EQ(entt::any_cast<int>(data[2u]), value[0u]);
 
     ASSERT_NE(entt::any_cast<entt::entity>(&data[3u]), nullptr);
     ASSERT_EQ(entt::any_cast<entt::entity>(data[3u]), entity[2u]);
 
     ASSERT_NE(entt::any_cast<int>(&data[4u]), nullptr);
-    ASSERT_EQ(entt::any_cast<int>(data[4u]), values[2u]);
+    ASSERT_EQ(entt::any_cast<int>(data[4u]), value[2u]);
 }
 
 TEST(BasicSnapshot, GetEmptyType) {
@@ -134,11 +137,12 @@ TEST(BasicSnapshot, GetEmptyType) {
     entt::registry registry;
     const entt::basic_snapshot snapshot{registry};
     const auto &storage = registry.storage<test::empty>();
+    constexpr auto number_of_entities = 3u;
 
-    entt::entity entity[3u]; // NOLINT
+    std::array<entt::entity, number_of_entities> entity{};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<test::empty>(std::begin(entity), std::end(entity));
+    registry.create(entity.begin(), entity.end());
+    registry.insert<test::empty>(entity.begin(), entity.end());
     registry.destroy(entity[1u]);
 
     std::vector<entt::any> data{};
@@ -172,18 +176,19 @@ TEST(BasicSnapshot, GetTypeSparse) {
 
     entt::registry registry;
     const entt::basic_snapshot snapshot{registry};
+    constexpr auto number_of_entities = 3u;
 
-    entt::entity entity[3u];       // NOLINT
-    const int values[3u]{1, 2, 3}; // NOLINT
+    std::array<entt::entity, number_of_entities> entity{};
+    const std::array<int, number_of_entities> value{1, 2, 3};
 
-    registry.create(std::begin(entity), std::end(entity));
-    registry.insert<int>(std::begin(entity), std::end(entity), std::begin(values));
+    registry.create(entity.begin(), entity.end());
+    registry.insert<int>(entity.begin(), entity.end(), value.begin());
     registry.destroy(entity[1u]);
 
     std::vector<entt::any> data{};
     auto archive = [&data](auto &&elem) { data.emplace_back(std::forward<decltype(elem)>(elem)); };
 
-    snapshot.get<int>(archive, std::begin(entity), std::end(entity), "other"_hs);
+    snapshot.get<int>(archive, entity.begin(), entity.end(), "other"_hs);
 
     ASSERT_EQ(data.size(), 1u);
 
@@ -191,18 +196,18 @@ TEST(BasicSnapshot, GetTypeSparse) {
     ASSERT_EQ(entt::any_cast<typename traits_type::entity_type>(data[0u]), 0u);
 
     data.clear();
-    snapshot.get<int>(archive, std::begin(entity), std::end(entity));
+    snapshot.get<int>(archive, entity.begin(), entity.end());
 
     ASSERT_EQ(data.size(), 6u);
 
     ASSERT_NE(entt::any_cast<typename traits_type::entity_type>(&data[0u]), nullptr);
-    ASSERT_EQ(entt::any_cast<typename traits_type::entity_type>(data[0u]), static_cast<typename traits_type::entity_type>(std::distance(std::begin(entity), std::end(entity))));
+    ASSERT_EQ(entt::any_cast<typename traits_type::entity_type>(data[0u]), static_cast<typename traits_type::entity_type>(std::distance(entity.begin(), entity.end())));
 
     ASSERT_NE(entt::any_cast<entt::entity>(&data[1u]), nullptr);
     ASSERT_EQ(entt::any_cast<entt::entity>(data[1u]), entity[0u]);
 
     ASSERT_NE(entt::any_cast<int>(&data[2u]), nullptr);
-    ASSERT_EQ(entt::any_cast<int>(data[2u]), values[0u]);
+    ASSERT_EQ(entt::any_cast<int>(data[2u]), value[0u]);
 
     ASSERT_NE(entt::any_cast<entt::entity>(&data[3u]), nullptr);
     ASSERT_EQ(entt::any_cast<entt::entity>(data[3u]), static_cast<entt::entity>(entt::null));
@@ -211,7 +216,7 @@ TEST(BasicSnapshot, GetTypeSparse) {
     ASSERT_EQ(entt::any_cast<entt::entity>(data[4u]), entity[2u]);
 
     ASSERT_NE(entt::any_cast<int>(&data[5u]), nullptr);
-    ASSERT_EQ(entt::any_cast<int>(data[5u]), values[2u]);
+    ASSERT_EQ(entt::any_cast<int>(data[5u]), value[2u]);
 }
 
 TEST(BasicSnapshotLoader, Constructors) {
@@ -245,7 +250,7 @@ TEST(BasicSnapshotLoader, GetEntityType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[3u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u), traits_type::construct(1u, 1u)}; // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u), traits_type::construct(1u, 1u)};
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -296,15 +301,15 @@ TEST(BasicSnapshotLoader, GetType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int values[2u]{1, 3};                                                                    // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const std::array value{1, 3};
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
 
     data.emplace_back(static_cast<typename traits_type::entity_type>(1u));
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     loader.get<int>(archive, "other"_hs);
 
@@ -317,10 +322,10 @@ TEST(BasicSnapshotLoader, GetType) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(2u));
 
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     data.emplace_back(entity[1u]);
-    data.emplace_back(values[1u]);
+    data.emplace_back(value[1u]);
 
     loader.get<int>(archive);
 
@@ -330,8 +335,8 @@ TEST(BasicSnapshotLoader, GetType) {
     ASSERT_EQ(storage.size(), 2u);
     ASSERT_TRUE(storage.contains(entity[0u]));
     ASSERT_TRUE(storage.contains(entity[1u]));
-    ASSERT_EQ(storage.get(entity[0u]), values[0u]);
-    ASSERT_EQ(storage.get(entity[1u]), values[1u]);
+    ASSERT_EQ(storage.get(entity[0u]), value[0u]);
+    ASSERT_EQ(storage.get(entity[1u]), value[1u]);
 }
 
 TEST(BasicSnapshotLoader, GetEmptyType) {
@@ -344,7 +349,7 @@ TEST(BasicSnapshotLoader, GetEmptyType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -385,8 +390,8 @@ TEST(BasicSnapshotLoader, GetTypeSparse) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int values[2u]{1, 3};                                                                    // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const std::array value{1, 3};
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -394,7 +399,7 @@ TEST(BasicSnapshotLoader, GetTypeSparse) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(2u));
     data.emplace_back(static_cast<entt::entity>(entt::null));
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     loader.get<int>(archive, "other"_hs);
 
@@ -407,12 +412,12 @@ TEST(BasicSnapshotLoader, GetTypeSparse) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(3u));
 
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     data.emplace_back(static_cast<entt::entity>(entt::null));
 
     data.emplace_back(entity[1u]);
-    data.emplace_back(values[1u]);
+    data.emplace_back(value[1u]);
 
     loader.get<int>(archive);
 
@@ -422,8 +427,8 @@ TEST(BasicSnapshotLoader, GetTypeSparse) {
     ASSERT_EQ(storage.size(), 2u);
     ASSERT_TRUE(storage.contains(entity[0u]));
     ASSERT_TRUE(storage.contains(entity[1u]));
-    ASSERT_EQ(storage.get(entity[0u]), values[0u]);
-    ASSERT_EQ(storage.get(entity[1u]), values[1u]);
+    ASSERT_EQ(storage.get(entity[0u]), value[0u]);
+    ASSERT_EQ(storage.get(entity[1u]), value[1u]);
 }
 
 TEST(BasicSnapshotLoader, GetTypeWithListener) {
@@ -462,8 +467,8 @@ TEST(BasicSnapshotLoader, Orphans) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int value = 42;
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const int value = 3;
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -514,7 +519,7 @@ TEST(BasicContinuousLoader, GetEntityType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[3u]{traits_type::construct(1u, 0u), traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
+    const std::array entity{traits_type::construct(1u, 0u), traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));
@@ -649,8 +654,8 @@ TEST(BasicContinuousLoader, GetType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int values[2u]{1, 3};                                                                    // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const std::array value{1, 3};
 
     ASSERT_FALSE(loader.contains(entity[0u]));
     ASSERT_FALSE(loader.contains(entity[1u]));
@@ -660,7 +665,7 @@ TEST(BasicContinuousLoader, GetType) {
 
     data.emplace_back(static_cast<typename traits_type::entity_type>(1u));
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     loader.get<int>(archive, "other"_hs);
 
@@ -676,10 +681,10 @@ TEST(BasicContinuousLoader, GetType) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(2u));
 
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     data.emplace_back(entity[1u]);
-    data.emplace_back(values[1u]);
+    data.emplace_back(value[1u]);
 
     loader.get<int>(archive);
 
@@ -692,8 +697,8 @@ TEST(BasicContinuousLoader, GetType) {
     ASSERT_EQ(storage.size(), 2u);
     ASSERT_TRUE(storage.contains(loader.map(entity[0u])));
     ASSERT_TRUE(storage.contains(loader.map(entity[1u])));
-    ASSERT_EQ(storage.get(loader.map(entity[0u])), values[0u]);
-    ASSERT_EQ(storage.get(loader.map(entity[1u])), values[1u]);
+    ASSERT_EQ(storage.get(loader.map(entity[0u])), value[0u]);
+    ASSERT_EQ(storage.get(loader.map(entity[1u])), value[1u]);
 }
 
 TEST(BasicContinuousLoader, GetTypeExtended) {
@@ -705,7 +710,7 @@ TEST(BasicContinuousLoader, GetTypeExtended) {
     const auto &storage = registry.storage<shadow>();
 
     std::vector<entt::any> data{};
-    const entt::entity entity[2u]{traits_type::construct(0u, 1u), traits_type::construct(1u, 1u)}; // NOLINT
+    const std::array entity{traits_type::construct(0u, 1u), traits_type::construct(1u, 1u)};
     const shadow value{entity[0u]};
 
     auto archive = [&loader, &data, pos = 0u](auto &elem) mutable {
@@ -759,7 +764,7 @@ TEST(BasicContinuousLoader, GetEmptyType) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
 
     ASSERT_FALSE(loader.contains(entity[0u]));
     ASSERT_FALSE(loader.contains(entity[1u]));
@@ -809,8 +814,8 @@ TEST(BasicContinuousLoader, GetTypeSparse) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int values[2u]{1, 3};                                                                    // NOLINT
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const std::array value{1, 3};
 
     ASSERT_FALSE(loader.contains(entity[0u]));
     ASSERT_FALSE(loader.contains(entity[1u]));
@@ -821,7 +826,7 @@ TEST(BasicContinuousLoader, GetTypeSparse) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(2u));
     data.emplace_back(static_cast<entt::entity>(entt::null));
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     loader.get<int>(archive, "other"_hs);
 
@@ -837,12 +842,12 @@ TEST(BasicContinuousLoader, GetTypeSparse) {
     data.emplace_back(static_cast<typename traits_type::entity_type>(3u));
 
     data.emplace_back(entity[0u]);
-    data.emplace_back(values[0u]);
+    data.emplace_back(value[0u]);
 
     data.emplace_back(static_cast<entt::entity>(entt::null));
 
     data.emplace_back(entity[1u]);
-    data.emplace_back(values[1u]);
+    data.emplace_back(value[1u]);
 
     loader.get<int>(archive);
 
@@ -855,8 +860,8 @@ TEST(BasicContinuousLoader, GetTypeSparse) {
     ASSERT_EQ(storage.size(), 2u);
     ASSERT_TRUE(storage.contains(loader.map(entity[0u])));
     ASSERT_TRUE(storage.contains(loader.map(entity[1u])));
-    ASSERT_EQ(storage.get(loader.map(entity[0u])), values[0u]);
-    ASSERT_EQ(storage.get(loader.map(entity[1u])), values[1u]);
+    ASSERT_EQ(storage.get(loader.map(entity[0u])), value[0u]);
+    ASSERT_EQ(storage.get(loader.map(entity[1u])), value[1u]);
 }
 
 TEST(BasicContinuousLoader, GetTypeWithListener) {
@@ -895,8 +900,8 @@ TEST(BasicContinuousLoader, Orphans) {
 
     std::vector<entt::any> data{};
     auto archive = [&data, pos = 0u](auto &elem) mutable { elem = entt::any_cast<std::remove_reference_t<decltype(elem)>>(data[pos++]); };
-    const entt::entity entity[2u]{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)}; // NOLINT
-    const int value = 42;
+    const std::array entity{traits_type::construct(0u, 0u), traits_type::construct(2u, 0u)};
+    const int value = 3;
 
     ASSERT_FALSE(registry.valid(entity[0u]));
     ASSERT_FALSE(registry.valid(entity[1u]));

File diff suppressed because it is too large
+ 179 - 185
test/entt/entity/sparse_set.cpp


+ 128 - 126
test/entt/entity/storage.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <array>
 #include <cstddef>
 #include <iterator>
 #include <memory>
@@ -161,10 +162,11 @@ TYPED_TEST(Storage, Swap) {
     ASSERT_EQ(pool.type(), entt::type_id<value_type>());
     ASSERT_EQ(other.type(), entt::type_id<value_type>());
 
-    pool.emplace(entt::entity{42}, 41); // NOLINT
-    other.emplace(entt::entity{9}, 8);  // NOLINT
-    other.emplace(entt::entity{3}, 2);
-    other.erase(entt::entity{9}); // NOLINT
+    pool.emplace(entt::entity{4}, 1);
+
+    other.emplace(entt::entity{2}, 2);
+    other.emplace(entt::entity{1}, 3);
+    other.erase(entt::entity{2});
 
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_EQ(other.size(), 1u + traits_type::in_place_delete);
@@ -177,11 +179,11 @@ TYPED_TEST(Storage, Swap) {
     ASSERT_EQ(pool.size(), 1u + traits_type::in_place_delete);
     ASSERT_EQ(other.size(), 1u);
 
-    ASSERT_EQ(pool.index(entt::entity{3}), traits_type::in_place_delete);
-    ASSERT_EQ(other.index(entt::entity{42}), 0u);
+    ASSERT_EQ(pool.index(entt::entity{1}), traits_type::in_place_delete);
+    ASSERT_EQ(other.index(entt::entity{4}), 0u);
 
-    ASSERT_EQ(pool.get(entt::entity{3}), value_type{2});
-    ASSERT_EQ(other.get(entt::entity{42}), value_type{41});
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{3});
+    ASSERT_EQ(other.get(entt::entity{4}), value_type{1});
 }
 
 TYPED_TEST(Storage, Capacity) {
@@ -189,7 +191,7 @@ TYPED_TEST(Storage, Capacity) {
     using traits_type = entt::component_traits<value_type>;
     entt::storage<value_type> pool;
 
-    pool.reserve(42); // NOLINT
+    pool.reserve(64);
 
     ASSERT_EQ(pool.capacity(), traits_type::page_size);
     ASSERT_TRUE(pool.empty());
@@ -236,11 +238,11 @@ TYPED_TEST(Storage, Raw) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
+    pool.emplace(entt::entity{1}, 1);
     pool.emplace(entt::entity{3}, 3);
-    pool.emplace(entt::entity{12}, 6); // NOLINT
 
-    ASSERT_EQ(pool.raw()[0u][0u], value_type{3});
-    ASSERT_EQ(std::as_const(pool).raw()[0u][1u], value_type{6});
+    ASSERT_EQ(pool.raw()[0u][0u], value_type{1});
+    ASSERT_EQ(std::as_const(pool).raw()[0u][1u], value_type{3});
 }
 
 TYPED_TEST(Storage, Iterator) {
@@ -252,7 +254,7 @@ TYPED_TEST(Storage, Iterator) {
     testing::StaticAssertTypeEq<typename iterator::reference, value_type &>();
 
     entt::storage<value_type> pool;
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
 
     iterator end{pool.begin()};
     iterator begin{};
@@ -296,14 +298,14 @@ TYPED_TEST(Storage, Iterator) {
     ASSERT_EQ(begin.index(), 0);
     ASSERT_EQ(end.index(), -1);
 
-    pool.emplace(entt::entity{42}, 3); // NOLINT
+    pool.emplace(entt::entity{3}, 4);
     begin = pool.begin();
 
     ASSERT_EQ(begin.index(), 1);
     ASSERT_EQ(end.index(), -1);
 
-    ASSERT_EQ(begin[0u], value_type{3});
-    ASSERT_EQ(begin[1u], value_type{42});
+    ASSERT_EQ(begin[0u], value_type{4});
+    ASSERT_EQ(begin[1u], value_type{2});
 }
 
 TYPED_TEST(Storage, ConstIterator) {
@@ -315,7 +317,7 @@ TYPED_TEST(Storage, ConstIterator) {
     testing::StaticAssertTypeEq<typename iterator::reference, const value_type &>();
 
     entt::storage<value_type> pool;
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
 
     iterator cend{pool.cbegin()};
     iterator cbegin{};
@@ -360,14 +362,14 @@ TYPED_TEST(Storage, ConstIterator) {
     ASSERT_EQ(cbegin.index(), 0);
     ASSERT_EQ(cend.index(), -1);
 
-    pool.emplace(entt::entity{42}, 3); // NOLINT
+    pool.emplace(entt::entity{3}, 4);
     cbegin = pool.cbegin();
 
     ASSERT_EQ(cbegin.index(), 1);
     ASSERT_EQ(cend.index(), -1);
 
-    ASSERT_EQ(cbegin[0u], value_type{3});
-    ASSERT_EQ(cbegin[1u], value_type{42});
+    ASSERT_EQ(cbegin[0u], value_type{4});
+    ASSERT_EQ(cbegin[1u], value_type{2});
 }
 
 TYPED_TEST(Storage, ReverseIterator) {
@@ -379,7 +381,7 @@ TYPED_TEST(Storage, ReverseIterator) {
     testing::StaticAssertTypeEq<typename reverse_iterator::reference, value_type &>();
 
     entt::storage<value_type> pool;
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
 
     reverse_iterator end{pool.rbegin()};
     reverse_iterator begin{};
@@ -422,14 +424,14 @@ TYPED_TEST(Storage, ReverseIterator) {
     ASSERT_EQ(begin.base().index(), -1);
     ASSERT_EQ(end.base().index(), 0);
 
-    pool.emplace(entt::entity{42}, 3); // NOLINT
+    pool.emplace(entt::entity{3}, 4);
     end = pool.rend();
 
     ASSERT_EQ(begin.base().index(), -1);
     ASSERT_EQ(end.base().index(), 1);
 
-    ASSERT_EQ(begin[0u], value_type{42});
-    ASSERT_EQ(begin[1u], value_type{3});
+    ASSERT_EQ(begin[0u], value_type{2});
+    ASSERT_EQ(begin[1u], value_type{4});
 }
 
 TYPED_TEST(Storage, ConstReverseIterator) {
@@ -441,7 +443,7 @@ TYPED_TEST(Storage, ConstReverseIterator) {
     testing::StaticAssertTypeEq<typename const_reverse_iterator::reference, const value_type &>();
 
     entt::storage<value_type> pool;
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
 
     const_reverse_iterator cend{pool.crbegin()};
     const_reverse_iterator cbegin{};
@@ -486,21 +488,21 @@ TYPED_TEST(Storage, ConstReverseIterator) {
     ASSERT_EQ(cbegin.base().index(), -1);
     ASSERT_EQ(cend.base().index(), 0);
 
-    pool.emplace(entt::entity{42}, 3); // NOLINT
+    pool.emplace(entt::entity{3}, 4);
     cend = pool.crend();
 
     ASSERT_EQ(cbegin.base().index(), -1);
     ASSERT_EQ(cend.base().index(), 1);
 
-    ASSERT_EQ(cbegin[0u], value_type{42});
-    ASSERT_EQ(cbegin[1u], value_type{3});
+    ASSERT_EQ(cbegin[0u], value_type{2});
+    ASSERT_EQ(cbegin[1u], value_type{4});
 }
 
 TYPED_TEST(Storage, IteratorConversion) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
 
     const typename entt::storage<value_type>::iterator it = pool.begin();
     typename entt::storage<value_type>::const_iterator cit = it;
@@ -508,7 +510,7 @@ TYPED_TEST(Storage, IteratorConversion) {
     testing::StaticAssertTypeEq<decltype(*it), value_type &>();
     testing::StaticAssertTypeEq<decltype(*cit), const value_type &>();
 
-    ASSERT_EQ(*it.operator->(), value_type{42});
+    ASSERT_EQ(*it.operator->(), value_type{2});
     ASSERT_EQ(*it.operator->(), *cit);
 
     ASSERT_EQ(it - cit, 0);
@@ -526,7 +528,7 @@ TYPED_TEST(Storage, IteratorPageSizeAwareness) {
     using traits_type = entt::component_traits<value_type>;
     entt::storage<value_type> pool;
 
-    const value_type check{42};
+    const value_type check{2};
 
     for(unsigned int next{}; next < traits_type::page_size; ++next) {
         pool.emplace(entt::entity{next});
@@ -542,7 +544,7 @@ TYPED_TEST(Storage, Getters) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{41}, 3); // NOLINT
+    pool.emplace(entt::entity{1}, 3);
 
     testing::StaticAssertTypeEq<decltype(pool.get({})), value_type &>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get({})), const value_type &>();
@@ -550,38 +552,38 @@ TYPED_TEST(Storage, Getters) {
     testing::StaticAssertTypeEq<decltype(pool.get_as_tuple({})), std::tuple<value_type &>>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get_as_tuple({})), std::tuple<const value_type &>>();
 
-    ASSERT_EQ(pool.get(entt::entity{41}), value_type{3});
-    ASSERT_EQ(std::as_const(pool).get(entt::entity{41}), value_type{3});
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{3});
+    ASSERT_EQ(std::as_const(pool).get(entt::entity{1}), value_type{3});
 
-    ASSERT_EQ(pool.get_as_tuple(entt::entity{41}), std::make_tuple(value_type{3}));
-    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{41}), std::make_tuple(value_type{3}));
+    ASSERT_EQ(pool.get_as_tuple(entt::entity{1}), std::make_tuple(value_type{3}));
+    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{1}), std::make_tuple(value_type{3}));
 }
 
 ENTT_DEBUG_TYPED_TEST(StorageDeathTest, Getters) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    ASSERT_DEATH([[maybe_unused]] const auto &value = pool.get(entt::entity{41}), "");
-    ASSERT_DEATH([[maybe_unused]] const auto &value = std::as_const(pool).get(entt::entity{41}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto &value = pool.get(entt::entity{4}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto &value = std::as_const(pool).get(entt::entity{4}), "");
 
-    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{41}), "");
-    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{41}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{4}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{4}), "");
 }
 
 TYPED_TEST(Storage, Value) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{2});
 
-    ASSERT_EQ(pool.value(entt::entity{42}), &pool.get(entt::entity{42}));
+    ASSERT_EQ(pool.value(entt::entity{2}), &pool.get(entt::entity{2}));
 }
 
 ENTT_DEBUG_TYPED_TEST(StorageDeathTest, Value) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    ASSERT_DEATH([[maybe_unused]] const void *value = pool.value(entt::entity{42}), "");
+    ASSERT_DEATH([[maybe_unused]] const void *value = pool.value(entt::entity{2}), "");
 }
 
 TYPED_TEST(Storage, Emplace) {
@@ -591,7 +593,7 @@ TYPED_TEST(Storage, Emplace) {
     testing::StaticAssertTypeEq<decltype(pool.emplace({})), value_type &>();
 
     ASSERT_EQ(pool.emplace(entt::entity{3}), value_type{});
-    ASSERT_EQ(pool.emplace(entt::entity{42}, 42), value_type{42});
+    ASSERT_EQ(pool.emplace(entt::entity{1}, 2), value_type{2});
 }
 
 TEST(Storage, EmplaceAggregate) {
@@ -602,17 +604,17 @@ TEST(Storage, EmplaceAggregate) {
     // aggregate types with no args enter the non-aggregate path
     ASSERT_EQ(pool.emplace(entt::entity{3}), test::aggregate{});
     // aggregate types with args work despite the lack of support in the standard library
-    ASSERT_EQ(pool.emplace(entt::entity{42}, 42), test::aggregate{42});
+    ASSERT_EQ(pool.emplace(entt::entity{1}, 2), test::aggregate{2});
 }
 
 TEST(Storage, EmplaceSelfMoveSupport) {
     // see #37 - this test shouldn't crash, that's all
     entt::storage<std::unordered_set<int>> pool;
-    const entt::entity entity{42};
+    const entt::entity entity{1};
 
     ASSERT_EQ(pool.policy(), entt::deletion_policy::swap_and_pop);
 
-    pool.emplace(entity).insert(42); // NOLINT
+    pool.emplace(entity).insert(2);
     pool.erase(entity);
 
     ASSERT_FALSE(pool.contains(entity));
@@ -621,11 +623,11 @@ TEST(Storage, EmplaceSelfMoveSupport) {
 TEST(Storage, EmplaceSelfMoveSupportInPlaceDelete) {
     // see #37 - this test shouldn't crash, that's all
     entt::storage<std::unordered_set<char>> pool;
-    const entt::entity entity{42};
+    const entt::entity entity{1};
 
     ASSERT_EQ(pool.policy(), entt::deletion_policy::in_place);
 
-    pool.emplace(entity).insert(42); // NOLINT
+    pool.emplace(entity).insert(2);
     pool.erase(entity);
 
     ASSERT_FALSE(pool.contains(entity));
@@ -637,19 +639,19 @@ TYPED_TEST(Storage, TryEmplace) {
     entt::storage<value_type> pool;
     entt::sparse_set &base = pool;
 
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
-    value_type instance{42};                                    // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
+    value_type instance{4};
 
     ASSERT_NE(base.push(entity[0u], &instance), base.end());
 
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_EQ(base.index(entity[0u]), 0u);
     ASSERT_EQ(base.value(entity[0u]), &pool.get(entity[0u]));
-    ASSERT_EQ(pool.get(entity[0u]), value_type{42});
+    ASSERT_EQ(pool.get(entity[0u]), value_type{4});
 
     base.erase(entity[0u]);
 
-    ASSERT_NE(base.push(std::begin(entity), std::end(entity)), base.end());
+    ASSERT_NE(base.push(entity.begin(), entity.end()), base.end());
 
     if constexpr(traits_type::in_place_delete) {
         ASSERT_EQ(pool.size(), 3u);
@@ -664,9 +666,9 @@ TYPED_TEST(Storage, TryEmplace) {
     ASSERT_EQ(pool.get(entity[0u]), value_type{});
     ASSERT_EQ(pool.get(entity[1u]), value_type{});
 
-    base.erase(std::begin(entity), std::end(entity));
+    base.erase(entity.begin(), entity.end());
 
-    ASSERT_NE(base.push(std::rbegin(entity), std::rend(entity)), base.end());
+    ASSERT_NE(base.push(entity.rbegin(), entity.rend()), base.end());
 
     if constexpr(traits_type::in_place_delete) {
         ASSERT_EQ(pool.size(), 5u);
@@ -689,7 +691,7 @@ TEST(Storage, TryEmplaceNonDefaultConstructible) {
     entt::storage<value_type> pool;
     entt::sparse_set &base = pool;
 
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
     ASSERT_EQ(pool.type(), entt::type_id<value_type>());
     ASSERT_EQ(pool.type(), base.type());
@@ -704,7 +706,7 @@ TEST(Storage, TryEmplaceNonDefaultConstructible) {
     ASSERT_EQ(base.find(entity[0u]), base.end());
     ASSERT_TRUE(pool.empty());
 
-    int value = 42; // NOLINT
+    int value = 4;
     value_type instance{value, value};
 
     ASSERT_NE(base.push(entity[0u], &instance), base.end());
@@ -717,7 +719,7 @@ TEST(Storage, TryEmplaceNonDefaultConstructible) {
     ASSERT_TRUE(pool.empty());
     ASSERT_FALSE(pool.contains(entity[0u]));
 
-    ASSERT_EQ(base.push(std::begin(entity), std::end(entity)), base.end());
+    ASSERT_EQ(base.push(entity.begin(), entity.end()), base.end());
 
     ASSERT_FALSE(pool.contains(entity[0u]));
     ASSERT_FALSE(pool.contains(entity[1u]));
@@ -733,7 +735,7 @@ TEST(Storage, TryEmplaceNonCopyConstructible) {
     entt::storage<value_type> pool;
     entt::sparse_set &base = pool;
 
-    entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
     ASSERT_EQ(pool.type(), entt::type_id<value_type>());
     ASSERT_EQ(pool.type(), base.type());
@@ -748,7 +750,7 @@ TEST(Storage, TryEmplaceNonCopyConstructible) {
     ASSERT_NE(base.find(entity[0u]), base.end());
     ASSERT_FALSE(pool.empty());
 
-    value_type instance = std::make_unique<int>(3);
+    value_type instance = std::make_unique<int>(4);
 
     ASSERT_EQ(base.push(entity[1u], &instance), base.end());
 
@@ -760,7 +762,7 @@ TEST(Storage, TryEmplaceNonCopyConstructible) {
     ASSERT_TRUE(pool.empty());
     ASSERT_FALSE(pool.contains(entity[0u]));
 
-    ASSERT_NE(base.push(std::begin(entity), std::end(entity)), base.end());
+    ASSERT_NE(base.push(entity.begin(), entity.end()), base.end());
 
     ASSERT_TRUE(pool.contains(entity[0u]));
     ASSERT_TRUE(pool.contains(entity[1u]));
@@ -773,7 +775,7 @@ TYPED_TEST(Storage, Patch) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity{42};
+    const entt::entity entity{2};
 
     auto callback = [](auto &&elem) {
         if constexpr(std::is_class_v<std::remove_reference_t<decltype(elem)>>) {
@@ -891,16 +893,16 @@ TYPED_TEST(Storage, CrossErase) {
     entt::storage<value_type> pool;
     entt::sparse_set set;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
-    pool.emplace(entity[0u], 3);
-    pool.emplace(entity[1u], 42); // NOLINT
+    pool.emplace(entity[0u], 1);
+    pool.emplace(entity[1u], 3);
     set.push(entity[1u]);
     pool.erase(set.begin(), set.end());
 
     ASSERT_TRUE(pool.contains(entity[0u]));
     ASSERT_FALSE(pool.contains(entity[1u]));
-    ASSERT_EQ(pool.raw()[0u][0u], value_type{3});
+    ASSERT_EQ(pool.raw()[0u][0u], value_type{1});
 }
 
 TYPED_TEST(Storage, Remove) {
@@ -908,8 +910,8 @@ TYPED_TEST(Storage, Remove) {
     using traits_type = entt::component_traits<value_type>;
     entt::storage<value_type> pool;
 
-    entt::entity entity[3u]{entt::entity{3}, entt::entity{42}, entt::entity{9}}; // NOLINT
-    const value_type values[3u]{value_type{0}, value_type{1}, value_type{2}};    // NOLINT
+    const entt::entity entity[3u]{entt::entity{3}, entt::entity{42}, entt::entity{9}}; // NOLINT
+    const value_type values[3u]{value_type{0}, value_type{1}, value_type{2}};          // NOLINT
 
     pool.insert(std::begin(entity), std::end(entity), std::begin(values));
 
@@ -951,16 +953,16 @@ TYPED_TEST(Storage, CrossRemove) {
     entt::storage<value_type> pool;
     entt::sparse_set set;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
-    pool.emplace(entity[0u], 3);
-    pool.emplace(entity[1u], 42); // NOLINT
+    pool.emplace(entity[0u], 1);
+    pool.emplace(entity[1u], 3);
     set.push(entity[1u]);
     pool.remove(set.begin(), set.end());
 
     ASSERT_TRUE(pool.contains(entity[0u]));
     ASSERT_FALSE(pool.contains(entity[1u]));
-    ASSERT_EQ(pool.raw()[0u][0u], value_type{3});
+    ASSERT_EQ(pool.raw()[0u][0u], value_type{1});
 }
 
 TYPED_TEST(Storage, Clear) {
@@ -1004,30 +1006,30 @@ TYPED_TEST(Storage, Compact) {
 
     ASSERT_EQ(pool.size(), 1u);
 
-    pool.emplace(entt::entity{42}, value_type{42}); // NOLINT
+    pool.emplace(entt::entity{4}, value_type{4});
     pool.erase(entt::entity{0});
 
     ASSERT_EQ(pool.size(), 1u + traits_type::in_place_delete);
-    ASSERT_EQ(pool.index(entt::entity{42}), traits_type::in_place_delete);
-    ASSERT_EQ(pool.get(entt::entity{42}), value_type{42});
+    ASSERT_EQ(pool.index(entt::entity{4}), traits_type::in_place_delete);
+    ASSERT_EQ(pool.get(entt::entity{4}), value_type{4});
 
     pool.compact();
 
     ASSERT_EQ(pool.size(), 1u);
-    ASSERT_EQ(pool.index(entt::entity{42}), 0u);
-    ASSERT_EQ(pool.get(entt::entity{42}), value_type{42});
+    ASSERT_EQ(pool.index(entt::entity{4}), 0u);
+    ASSERT_EQ(pool.get(entt::entity{4}), value_type{4});
 
     pool.emplace(entt::entity{0}, value_type{0});
     pool.compact();
 
     ASSERT_EQ(pool.size(), 2u);
-    ASSERT_EQ(pool.index(entt::entity{42}), 0u);
+    ASSERT_EQ(pool.index(entt::entity{4}), 0u);
     ASSERT_EQ(pool.index(entt::entity{0}), 1u);
-    ASSERT_EQ(pool.get(entt::entity{42}), value_type{42});
+    ASSERT_EQ(pool.get(entt::entity{4}), value_type{4});
     ASSERT_EQ(pool.get(entt::entity{0}), value_type{0});
 
     pool.erase(entt::entity{0});
-    pool.erase(entt::entity{42}); // NOLINT
+    pool.erase(entt::entity{4});
     pool.compact();
 
     ASSERT_TRUE(pool.empty());
@@ -1038,23 +1040,23 @@ TYPED_TEST(Storage, SwapElements) {
     using traits_type = entt::component_traits<value_type>;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 3);
-    pool.emplace(entt::entity{12}, 6); // NOLINT
-    pool.emplace(entt::entity{42}, 9); // NOLINT
+    pool.emplace(entt::entity{1}, 1);
+    pool.emplace(entt::entity{2}, 3);
+    pool.emplace(entt::entity{4}, 8);
 
-    pool.erase(entt::entity{12}); // NOLINT
+    pool.erase(entt::entity{2});
 
-    ASSERT_EQ(pool.get(entt::entity{3}), value_type{3});
-    ASSERT_EQ(pool.get(entt::entity{42}), value_type{9});
-    ASSERT_EQ(pool.index(entt::entity{3}), 0u);
-    ASSERT_EQ(pool.index(entt::entity{42}), 1u + traits_type::in_place_delete);
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{1});
+    ASSERT_EQ(pool.get(entt::entity{4}), value_type{8});
+    ASSERT_EQ(pool.index(entt::entity{1}), 0u);
+    ASSERT_EQ(pool.index(entt::entity{4}), 1u + traits_type::in_place_delete);
 
-    pool.swap_elements(entt::entity{3}, entt::entity{42}); // NOLINT
+    pool.swap_elements(entt::entity{1}, entt::entity{4});
 
-    ASSERT_EQ(pool.get(entt::entity{3}), value_type{3});
-    ASSERT_EQ(pool.get(entt::entity{42}), value_type{9});
-    ASSERT_EQ(pool.index(entt::entity{3}), 1u + traits_type::in_place_delete);
-    ASSERT_EQ(pool.index(entt::entity{42}), 0u);
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{1});
+    ASSERT_EQ(pool.get(entt::entity{4}), value_type{8});
+    ASSERT_EQ(pool.index(entt::entity{1}), 1u + traits_type::in_place_delete);
+    ASSERT_EQ(pool.index(entt::entity{4}), 0u);
 }
 
 TYPED_TEST(Storage, Iterable) {
@@ -1068,8 +1070,8 @@ TYPED_TEST(Storage, Iterable) {
     entt::storage<value_type> pool;
     const entt::sparse_set &base = pool;
 
-    pool.emplace(entt::entity{1}, 99); // NOLINT
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
+    pool.emplace(entt::entity{3}, 4);
 
     auto iterable = pool.each();
 
@@ -1087,9 +1089,9 @@ TYPED_TEST(Storage, Iterable) {
     ASSERT_EQ(end.base(), base.end());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{3});
-    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{42});
+    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{4});
     ASSERT_EQ(std::get<0>(*begin), entt::entity{3});
-    ASSERT_EQ(std::get<1>(*begin), value_type{42});
+    ASSERT_EQ(std::get<1>(*begin), value_type{4});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), ++base.begin());
@@ -1099,8 +1101,8 @@ TYPED_TEST(Storage, Iterable) {
     for(auto [entity, element]: iterable) {
         testing::StaticAssertTypeEq<decltype(entity), entt::entity>();
         testing::StaticAssertTypeEq<decltype(element), value_type &>();
-        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{99});
-        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{42});
+        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{2});
+        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{4});
     }
 }
 
@@ -1115,8 +1117,8 @@ TYPED_TEST(Storage, ConstIterable) {
     entt::storage<value_type> pool;
     const entt::sparse_set &base = pool;
 
-    pool.emplace(entt::entity{1}, 99); // NOLINT
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
+    pool.emplace(entt::entity{3}, 4);
 
     auto iterable = std::as_const(pool).each();
 
@@ -1134,9 +1136,9 @@ TYPED_TEST(Storage, ConstIterable) {
     ASSERT_EQ(end.base(), base.end());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{3});
-    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{42});
+    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{4});
     ASSERT_EQ(std::get<0>(*begin), entt::entity{3});
-    ASSERT_EQ(std::get<1>(*begin), value_type{42});
+    ASSERT_EQ(std::get<1>(*begin), value_type{4});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), ++base.begin());
@@ -1146,8 +1148,8 @@ TYPED_TEST(Storage, ConstIterable) {
     for(auto [entity, element]: iterable) {
         testing::StaticAssertTypeEq<decltype(entity), entt::entity>();
         testing::StaticAssertTypeEq<decltype(element), const value_type &>();
-        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{99});
-        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{42});
+        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{2});
+        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{4});
     }
 }
 
@@ -1155,7 +1157,7 @@ TYPED_TEST(Storage, IterableIteratorConversion) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{3}, 1);
 
     const typename entt::storage<value_type>::iterable::iterator it = pool.each().begin();
     typename entt::storage<value_type>::const_iterable::iterator cit = it;
@@ -1171,7 +1173,7 @@ TYPED_TEST(Storage, IterableAlgorithmCompatibility) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{3}, 1);
 
     const auto iterable = pool.each();
     const auto it = std::find_if(iterable.begin(), iterable.end(), [](auto args) { return std::get<0>(args) == entt::entity{3}; });
@@ -1190,8 +1192,8 @@ TYPED_TEST(Storage, ReverseIterable) {
     entt::storage<value_type> pool;
     const entt::sparse_set &base = pool;
 
-    pool.emplace(entt::entity{1}, 99); // NOLINT
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
+    pool.emplace(entt::entity{3}, 4);
 
     auto iterable = pool.reach();
 
@@ -1209,9 +1211,9 @@ TYPED_TEST(Storage, ReverseIterable) {
     ASSERT_EQ(end.base(), base.rend());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{1});
-    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{99});
+    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{2});
     ASSERT_EQ(std::get<0>(*begin), entt::entity{1});
-    ASSERT_EQ(std::get<1>(*begin), value_type{99});
+    ASSERT_EQ(std::get<1>(*begin), value_type{2});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), ++base.rbegin());
@@ -1221,8 +1223,8 @@ TYPED_TEST(Storage, ReverseIterable) {
     for(auto [entity, element]: iterable) {
         testing::StaticAssertTypeEq<decltype(entity), entt::entity>();
         testing::StaticAssertTypeEq<decltype(element), value_type &>();
-        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{99});
-        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{42});
+        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{2});
+        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{4});
     }
 }
 
@@ -1237,8 +1239,8 @@ TYPED_TEST(Storage, ConstReverseIterable) {
     entt::storage<value_type> pool;
     const entt::sparse_set &base = pool;
 
-    pool.emplace(entt::entity{1}, 99); // NOLINT
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{1}, 2);
+    pool.emplace(entt::entity{3}, 4);
 
     auto iterable = std::as_const(pool).reach();
 
@@ -1256,9 +1258,9 @@ TYPED_TEST(Storage, ConstReverseIterable) {
     ASSERT_EQ(end.base(), base.rend());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{1});
-    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{99});
+    ASSERT_EQ(std::get<1>(*begin.operator->().operator->()), value_type{2});
     ASSERT_EQ(std::get<0>(*begin), entt::entity{1});
-    ASSERT_EQ(std::get<1>(*begin), value_type{99});
+    ASSERT_EQ(std::get<1>(*begin), value_type{2});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), ++base.rbegin());
@@ -1268,8 +1270,8 @@ TYPED_TEST(Storage, ConstReverseIterable) {
     for(auto [entity, element]: iterable) {
         testing::StaticAssertTypeEq<decltype(entity), entt::entity>();
         testing::StaticAssertTypeEq<decltype(element), const value_type &>();
-        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{99});
-        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{42});
+        ASSERT_TRUE(entity != entt::entity{1} || element == value_type{2});
+        ASSERT_TRUE(entity != entt::entity{3} || element == value_type{4});
     }
 }
 
@@ -1277,7 +1279,7 @@ TYPED_TEST(Storage, ReverseIterableIteratorConversion) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{3}, 1);
 
     const typename entt::storage<value_type>::reverse_iterable::iterator it = pool.reach().begin();
     typename entt::storage<value_type>::const_reverse_iterable::iterator cit = it;
@@ -1293,7 +1295,7 @@ TYPED_TEST(Storage, ReverseIterableAlgorithmCompatibility) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{3}, 42); // NOLINT
+    pool.emplace(entt::entity{3}, 1);
 
     const auto iterable = pool.reach();
     const auto it = std::find_if(iterable.begin(), iterable.end(), [](auto args) { return std::get<0>(args) == entt::entity{3}; });
@@ -1601,7 +1603,7 @@ TYPED_TEST(Storage, CanModifyDuringIteration) {
     using traits_type = entt::component_traits<value_type>;
     entt::storage<value_type> pool;
 
-    auto *ptr = &pool.emplace(entt::entity{0}, 42); // NOLINT
+    auto *ptr = &pool.emplace(entt::entity{0}, 2);
 
     ASSERT_EQ(pool.capacity(), traits_type::page_size);
 
@@ -1627,12 +1629,12 @@ TYPED_TEST(Storage, ReferencesGuaranteed) {
 
     for(auto &&elem: pool) {
         if(!(elem == value_type{})) {
-            elem = value_type{42}; // NOLINT
+            elem = value_type{4};
         }
     }
 
     ASSERT_EQ(pool.get(entt::entity{0}), value_type{0});
-    ASSERT_EQ(pool.get(entt::entity{1}), value_type{42});
+    ASSERT_EQ(pool.get(entt::entity{1}), value_type{4});
 
     auto begin = pool.begin();
 
@@ -1842,7 +1844,7 @@ TYPED_TEST(Storage, NoUsesAllocatorConstruction) {
     using value_type = typename TestFixture::type;
     test::tracked_memory_resource memory_resource{};
     entt::basic_storage<value_type, entt::entity, std::pmr::polymorphic_allocator<value_type>> pool{&memory_resource};
-    const entt::entity entity{42};
+    const entt::entity entity{2};
 
     pool.emplace(entity);
     pool.erase(entity);
@@ -1858,7 +1860,7 @@ TEST(Storage, UsesAllocatorConstruction) {
     using string_type = typename test::tracked_memory_resource::string_type;
     test::tracked_memory_resource memory_resource{};
     entt::basic_storage<string_type, entt::entity, std::pmr::polymorphic_allocator<string_type>> pool{&memory_resource};
-    const entt::entity entity{42};
+    const entt::entity entity{2};
 
     pool.emplace(entity);
     pool.erase(entity);

+ 52 - 51
test/entt/entity/storage_entity.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <array>
 #include <functional>
 #include <iterator>
 #include <memory>
@@ -110,7 +111,7 @@ TEST(StorageEntity, Swap) {
 TEST(StorageEntity, Getters) {
     entt::storage<entt::entity> pool;
 
-    pool.emplace(entt::entity{41}); // NOLINT
+    pool.emplace(entt::entity{4});
 
     testing::StaticAssertTypeEq<decltype(pool.get({})), void>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get({})), void>();
@@ -118,21 +119,21 @@ TEST(StorageEntity, Getters) {
     testing::StaticAssertTypeEq<decltype(pool.get_as_tuple({})), std::tuple<>>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get_as_tuple({})), std::tuple<>>();
 
-    ASSERT_NO_THROW(pool.get(entt::entity{41}));
-    ASSERT_NO_THROW(std::as_const(pool).get(entt::entity{41}));
+    ASSERT_NO_THROW(pool.get(entt::entity{4}));
+    ASSERT_NO_THROW(std::as_const(pool).get(entt::entity{4}));
 
-    ASSERT_EQ(pool.get_as_tuple(entt::entity{41}), std::make_tuple());
-    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{41}), std::make_tuple());
+    ASSERT_EQ(pool.get_as_tuple(entt::entity{4}), std::make_tuple());
+    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{4}), std::make_tuple());
 }
 
 ENTT_DEBUG_TEST(StorageEntityDeathTest, Getters) {
     entt::storage<entt::entity> pool;
 
-    ASSERT_DEATH(pool.get(entt::entity{41}), "");
-    ASSERT_DEATH(std::as_const(pool).get(entt::entity{41}), "");
+    ASSERT_DEATH(pool.get(entt::entity{4}), "");
+    ASSERT_DEATH(std::as_const(pool).get(entt::entity{4}), "");
 
-    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{41}), "");
-    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{41}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{4}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{4}), "");
 }
 
 TEST(StorageEntity, Emplace) {
@@ -148,13 +149,13 @@ TEST(StorageEntity, Emplace) {
     ASSERT_EQ(pool.emplace(traits_type::construct(1, 1)), entt::entity{4});
     ASSERT_EQ(pool.emplace(traits_type::construct(6, 3)), traits_type::construct(6, 3));
 
-    ASSERT_LT(pool.index(entt::entity{0}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{1}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{2}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{3}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{4}), pool.in_use());              // NOLINT
-    ASSERT_GE(pool.index(entt::entity{5}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(traits_type::construct(6, 3)), pool.in_use()); // NOLINT
+    ASSERT_LT(pool.index(entt::entity{0}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{1}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{2}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{3}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{4}), pool.free_list());
+    ASSERT_GE(pool.index(entt::entity{5}), pool.free_list());
+    ASSERT_LT(pool.index(traits_type::construct(6, 3)), pool.free_list());
 
     ASSERT_EQ(pool.emplace(traits_type::construct(5, 42)), traits_type::construct(5, 42));
     ASSERT_EQ(pool.emplace(traits_type::construct(5, 43)), entt::entity{7});
@@ -181,12 +182,12 @@ TEST(StorageEntity, TryEmplace) {
     ASSERT_EQ(*pool.push(traits_type::construct(1, 1)), entt::entity{3});
     ASSERT_EQ(*pool.push(traits_type::construct(5, 3)), traits_type::construct(5, 3));
 
-    ASSERT_LT(pool.index(entt::entity{0}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{1}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{2}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(entt::entity{3}), pool.in_use());              // NOLINT
-    ASSERT_GE(pool.index(entt::entity{4}), pool.in_use());              // NOLINT
-    ASSERT_LT(pool.index(traits_type::construct(5, 3)), pool.in_use()); // NOLINT
+    ASSERT_LT(pool.index(entt::entity{0}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{1}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{2}), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{3}), pool.free_list());
+    ASSERT_GE(pool.index(entt::entity{4}), pool.free_list());
+    ASSERT_LT(pool.index(traits_type::construct(5, 3)), pool.free_list());
 
     ASSERT_EQ(*pool.push(traits_type::construct(4, 42)), traits_type::construct(4, 42));
     ASSERT_EQ(*pool.push(traits_type::construct(4, 43)), entt::entity{6});
@@ -200,12 +201,12 @@ TEST(StorageEntity, TryEmplace) {
     ASSERT_EQ(pool.current(entity[1u]), 4);
     ASSERT_EQ(pool.current(entt::entity{2}), 1);
 
-    ASSERT_LT(pool.index(entt::entity{0}), pool.in_use());               // NOLINT
-    ASSERT_GE(pool.index(traits_type::construct(1, 1)), pool.in_use());  // NOLINT
-    ASSERT_GE(pool.index(traits_type::construct(2, 1)), pool.in_use());  // NOLINT
-    ASSERT_LT(pool.index(entt::entity{3}), pool.in_use());               // NOLINT
-    ASSERT_LT(pool.index(traits_type::construct(4, 42)), pool.in_use()); // NOLINT
-    ASSERT_GE(pool.index(traits_type::construct(5, 4)), pool.in_use());  // NOLINT
+    ASSERT_LT(pool.index(entt::entity{0}), pool.free_list());
+    ASSERT_GE(pool.index(traits_type::construct(1, 1)), pool.free_list());
+    ASSERT_GE(pool.index(traits_type::construct(2, 1)), pool.free_list());
+    ASSERT_LT(pool.index(entt::entity{3}), pool.free_list());
+    ASSERT_LT(pool.index(traits_type::construct(4, 42)), pool.free_list());
+    ASSERT_GE(pool.index(traits_type::construct(5, 4)), pool.free_list());
 
     ASSERT_EQ(*pool.push(entt::null), traits_type::construct(2, 1));
     ASSERT_EQ(*pool.push(traits_type::construct(1, 3)), traits_type::construct(1, 3));
@@ -237,41 +238,41 @@ ENTT_DEBUG_TEST(StorageEntityDeathTest, Patch) {
 
 TEST(StorageEntity, Insert) {
     entt::storage<entt::entity> pool;
-    entt::entity entity[2u]{}; // NOLINT
+    std::array<entt::entity, 2u> entity{};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
 
     ASSERT_TRUE(pool.contains(entity[0u]));
     ASSERT_TRUE(pool.contains(entity[1u]));
 
     ASSERT_FALSE(pool.empty());
     ASSERT_EQ(pool.size(), 2u);
-    ASSERT_EQ(pool.in_use(), 2u); // NOLINT
+    ASSERT_EQ(pool.free_list(), 2u);
 
-    pool.erase(std::begin(entity), std::end(entity));
+    pool.erase(entity.begin(), entity.end());
 
     ASSERT_FALSE(pool.empty());
     ASSERT_EQ(pool.size(), 2u);
-    ASSERT_EQ(pool.in_use(), 0u); // NOLINT
+    ASSERT_EQ(pool.free_list(), 0u);
 
-    pool.insert(entity, entity + 1u); // NOLINT
+    pool.insert(entity.begin(), entity.begin() + 1u);
 
     ASSERT_TRUE(pool.contains(entity[0u]));
     ASSERT_FALSE(pool.contains(entity[1u]));
 
     ASSERT_FALSE(pool.empty());
     ASSERT_EQ(pool.size(), 2u);
-    ASSERT_EQ(pool.in_use(), 1u); // NOLINT
+    ASSERT_EQ(pool.free_list(), 1u);
 }
 
 TEST(StorageEntity, Pack) {
     entt::storage<entt::entity> pool;
-    entt::entity entity[3u]{entt::entity{1}, entt::entity{3}, entt::entity{42}}; // NOLINT
+    std::array entity{entt::entity{1}, entt::entity{3}, entt::entity{4}};
 
-    pool.push(entity, entity + 3u); // NOLINT
+    pool.push(entity.begin(), entity.end());
     std::swap(entity[0u], entity[1u]);
 
-    const auto len = pool.pack(entity + 1u, entity + 3u); // NOLINT
+    const auto len = pool.pack(entity.begin() + 1u, entity.end()); // NOLINT
     auto it = pool.each().cbegin().base();
 
     ASSERT_NE(it, pool.cbegin());
@@ -313,7 +314,7 @@ ENTT_DEBUG_TEST(StorageEntityDeathTest, InUse) {
 
     pool.emplace(entt::entity{0});
 
-    ASSERT_DEATH(pool.in_use(2u), ""); // NOLINT
+    ASSERT_DEATH(pool.free_list(2u), "");
 }
 
 TEST(StorageEntity, Iterable) {
@@ -327,7 +328,7 @@ TEST(StorageEntity, Iterable) {
 
     pool.emplace(entt::entity{1});
     pool.emplace(entt::entity{3});
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
     pool.erase(entt::entity{3});
 
@@ -343,11 +344,11 @@ TEST(StorageEntity, Iterable) {
     ASSERT_NE(begin, end);
 
     ASSERT_NE(begin.base(), pool.begin());
-    ASSERT_EQ(begin.base(), pool.end() - pool.in_use()); // NOLINT
+    ASSERT_EQ(begin.base(), pool.end() - pool.free_list());
     ASSERT_EQ(end.base(), pool.end());
 
-    ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{42});
-    ASSERT_EQ(std::get<0>(*begin), entt::entity{42});
+    ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{4});
+    ASSERT_EQ(std::get<0>(*begin), entt::entity{4});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), pool.end() - 1);
@@ -371,7 +372,7 @@ TEST(StorageEntity, ConstIterable) {
 
     pool.emplace(entt::entity{1});
     pool.emplace(entt::entity{3});
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
     pool.erase(entt::entity{3});
 
@@ -387,11 +388,11 @@ TEST(StorageEntity, ConstIterable) {
     ASSERT_NE(begin, end);
 
     ASSERT_NE(begin.base(), pool.begin());
-    ASSERT_EQ(begin.base(), pool.end() - pool.in_use()); // NOLINT
+    ASSERT_EQ(begin.base(), pool.end() - pool.free_list());
     ASSERT_EQ(end.base(), pool.end());
 
-    ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{42});
-    ASSERT_EQ(std::get<0>(*begin), entt::entity{42});
+    ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{4});
+    ASSERT_EQ(std::get<0>(*begin), entt::entity{4});
 
     ASSERT_EQ(begin++, iterable.begin());
     ASSERT_EQ(begin.base(), pool.end() - 1);
@@ -439,7 +440,7 @@ TEST(StorageEntity, ReverseIterable) {
 
     pool.emplace(entt::entity{1});
     pool.emplace(entt::entity{3});
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
     pool.erase(entt::entity{3});
 
@@ -455,7 +456,7 @@ TEST(StorageEntity, ReverseIterable) {
     ASSERT_NE(begin, end);
 
     ASSERT_EQ(begin.base(), pool.rbegin());
-    ASSERT_EQ(end.base(), pool.rbegin() + pool.in_use()); // NOLINT
+    ASSERT_EQ(end.base(), pool.rbegin() + pool.free_list());
     ASSERT_NE(end.base(), pool.rend());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{1});
@@ -483,7 +484,7 @@ TEST(StorageEntity, ReverseConstIterable) {
 
     pool.emplace(entt::entity{1});
     pool.emplace(entt::entity{3});
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
     pool.erase(entt::entity{3});
 
@@ -499,7 +500,7 @@ TEST(StorageEntity, ReverseConstIterable) {
     ASSERT_NE(begin, end);
 
     ASSERT_EQ(begin.base(), pool.rbegin());
-    ASSERT_EQ(end.base(), pool.rbegin() + pool.in_use()); // NOLINT
+    ASSERT_EQ(end.base(), pool.rbegin() + pool.free_list());
     ASSERT_NE(end.base(), pool.rend());
 
     ASSERT_EQ(std::get<0>(*begin.operator->().operator->()), entt::entity{1});

+ 77 - 76
test/entt/entity/storage_no_instance.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <array>
 #include <functional>
 #include <iterator>
 #include <memory>
@@ -30,8 +31,8 @@ struct StorageNoInstance: testing::Test {
         if constexpr(std::is_void_v<type>) {
             return pool.insert(from, to);
         } else {
-            const type values[2u]{}; // NOLINT
-            return pool.insert(from, to, std::begin(values));
+            const std::array<type, 2u> value{};
+            return pool.insert(from, to, value.begin());
         }
     }
 
@@ -110,7 +111,7 @@ TYPED_TEST(StorageNoInstance, Move) {
     ASSERT_EQ(pool.index(entt::entity{3}), 0u);
 
     other = entt::storage<value_type>{};
-    other.emplace(entt::entity{42}, 42); // NOLINT
+    other.emplace(entt::entity{2}, 2);
     other = std::move(pool);
 
     ASSERT_TRUE(pool.empty()); // NOLINT
@@ -130,11 +131,11 @@ TYPED_TEST(StorageNoInstance, Swap) {
     ASSERT_EQ(pool.type(), entt::type_id<value_type>());
     ASSERT_EQ(other.type(), entt::type_id<value_type>());
 
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
-    other.emplace(entt::entity{9}); // NOLINT
-    other.emplace(entt::entity{3});
-    other.erase(entt::entity{9}); // NOLINT
+    other.emplace(entt::entity{2});
+    other.emplace(entt::entity{1});
+    other.erase(entt::entity{2});
 
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_EQ(other.size(), 1u);
@@ -147,15 +148,15 @@ TYPED_TEST(StorageNoInstance, Swap) {
     ASSERT_EQ(pool.size(), 1u);
     ASSERT_EQ(other.size(), 1u);
 
-    ASSERT_EQ(pool.index(entt::entity{3}), 0u);
-    ASSERT_EQ(other.index(entt::entity{42}), 0u);
+    ASSERT_EQ(pool.index(entt::entity{1}), 0u);
+    ASSERT_EQ(other.index(entt::entity{4}), 0u);
 }
 
 TYPED_TEST(StorageNoInstance, Getters) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{41}, 3); // NOLINT
+    pool.emplace(entt::entity{4}, 3);
 
     testing::StaticAssertTypeEq<decltype(pool.get({})), void>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get({})), void>();
@@ -163,45 +164,45 @@ TYPED_TEST(StorageNoInstance, Getters) {
     testing::StaticAssertTypeEq<decltype(pool.get_as_tuple({})), std::tuple<>>();
     testing::StaticAssertTypeEq<decltype(std::as_const(pool).get_as_tuple({})), std::tuple<>>();
 
-    ASSERT_NO_THROW(pool.get(entt::entity{41}));
-    ASSERT_NO_THROW(std::as_const(pool).get(entt::entity{41}));
+    ASSERT_NO_THROW(pool.get(entt::entity{4}));
+    ASSERT_NO_THROW(std::as_const(pool).get(entt::entity{4}));
 
-    ASSERT_EQ(pool.get_as_tuple(entt::entity{41}), std::make_tuple());
-    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{41}), std::make_tuple());
+    ASSERT_EQ(pool.get_as_tuple(entt::entity{4}), std::make_tuple());
+    ASSERT_EQ(std::as_const(pool).get_as_tuple(entt::entity{4}), std::make_tuple());
 }
 
 ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Getters) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    ASSERT_DEATH(pool.get(entt::entity{41}), "");
-    ASSERT_DEATH(std::as_const(pool).get(entt::entity{41}), "");
+    ASSERT_DEATH(pool.get(entt::entity{4}), "");
+    ASSERT_DEATH(std::as_const(pool).get(entt::entity{4}), "");
 
-    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{41}), "");
-    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{41}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = pool.get_as_tuple(entt::entity{4}), "");
+    ASSERT_DEATH([[maybe_unused]] const auto value = std::as_const(pool).get_as_tuple(entt::entity{4}), "");
 }
 
 TYPED_TEST(StorageNoInstance, Value) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    pool.emplace(entt::entity{42}); // NOLINT
+    pool.emplace(entt::entity{4});
 
-    ASSERT_EQ(pool.value(entt::entity{42}), nullptr);
+    ASSERT_EQ(pool.value(entt::entity{4}), nullptr);
 }
 
 ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Value) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    ASSERT_DEATH([[maybe_unused]] const void *value = pool.value(entt::entity{42}), "");
+    ASSERT_DEATH([[maybe_unused]] const void *value = pool.value(entt::entity{4}), "");
 }
 
 TYPED_TEST(StorageNoInstance, Emplace) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
     testing::StaticAssertTypeEq<decltype(pool.emplace({})), void>();
 
@@ -213,7 +214,7 @@ ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Emplace) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity{42};
+    const entt::entity entity{4};
 
     testing::StaticAssertTypeEq<decltype(pool.emplace({})), void>();
 
@@ -228,7 +229,7 @@ TYPED_TEST(StorageNoInstance, TryEmplace) {
     entt::storage<value_type> pool;
     entt::sparse_set &base = pool;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
     ASSERT_NE(this->push_instance(pool, entity[0u]), base.end());
 
@@ -237,15 +238,15 @@ TYPED_TEST(StorageNoInstance, TryEmplace) {
 
     base.erase(entity[0u]);
 
-    ASSERT_NE(base.push(std::begin(entity), std::end(entity)), base.end());
+    ASSERT_NE(base.push(entity.begin(), entity.end()), base.end());
 
     ASSERT_EQ(pool.size(), 2u);
     ASSERT_EQ(base.index(entity[0u]), 0u);
     ASSERT_EQ(base.index(entity[1u]), 1u);
 
-    base.erase(std::begin(entity), std::end(entity));
+    base.erase(entity.begin(), entity.end());
 
-    ASSERT_NE(base.push(std::rbegin(entity), std::rend(entity)), base.end());
+    ASSERT_NE(base.push(entity.rbegin(), entity.rend()), base.end());
 
     ASSERT_EQ(pool.size(), 2u);
     ASSERT_EQ(base.index(entity[0u]), 1u);
@@ -256,7 +257,7 @@ TYPED_TEST(StorageNoInstance, Patch) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity{42};
+    const entt::entity entity{4};
 
     int counter = 0;
     auto callback = [&counter]() { ++counter; };
@@ -283,16 +284,16 @@ TYPED_TEST(StorageNoInstance, Insert) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
 
     ASSERT_EQ(pool.size(), 2u);
     ASSERT_EQ(pool.index(entity[0u]), 0u);
     ASSERT_EQ(pool.index(entity[1u]), 1u);
 
-    pool.erase(std::begin(entity), std::end(entity));
-    this->insert_instance(pool, std::rbegin(entity), std::rend(entity));
+    pool.erase(entity.begin(), entity.end());
+    this->insert_instance(pool, entity.rbegin(), entity.rend());
 
     ASSERT_EQ(pool.size(), 2u);
     ASSERT_EQ(pool.index(entity[0u]), 1u);
@@ -303,12 +304,12 @@ ENTT_DEBUG_TYPED_TEST(StorageNoInstanceDeathTest, Insert) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    const entt::entity entity[2u]{entt::entity{3}, entt::entity{42}}; // NOLINT
+    const std::array entity{entt::entity{1}, entt::entity{3}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
 
-    ASSERT_DEATH(pool.insert(std::begin(entity), std::end(entity)), "");
-    ASSERT_DEATH(this->insert_instance(pool, std::begin(entity), std::end(entity)), "");
+    ASSERT_DEATH(pool.insert(entity.begin(), entity.end()), "");
+    ASSERT_DEATH(this->insert_instance(pool, entity.begin(), entity.end()), "");
 }
 
 TYPED_TEST(StorageNoInstance, Iterable) {
@@ -547,33 +548,33 @@ TYPED_TEST(StorageNoInstance, SortOrdered) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    entt::entity entity[5u]{entt::entity{42}, entt::entity{12}, entt::entity{9}, entt::entity{7}, entt::entity{3}}; // NOLINT
+    std::array entity{entt::entity{16}, entt::entity{8}, entt::entity{4}, entt::entity{2}, entt::entity{1}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
     pool.sort(std::less{});
 
-    ASSERT_TRUE(std::equal(std::rbegin(entity), std::rend(entity), pool.begin(), pool.end()));
+    ASSERT_TRUE(std::equal(entity.rbegin(), entity.rend(), pool.begin(), pool.end()));
 }
 
 TYPED_TEST(StorageNoInstance, SortReverse) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    entt::entity entity[5u]{entt::entity{3}, entt::entity{7}, entt::entity{9}, entt::entity{12}, entt::entity{42}}; // NOLINT
+    std::array entity{entt::entity{1}, entt::entity{2}, entt::entity{4}, entt::entity{8}, entt::entity{16}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
     pool.sort(std::less{});
 
-    ASSERT_TRUE(std::equal(std::begin(entity), std::end(entity), pool.begin(), pool.end()));
+    ASSERT_TRUE(std::equal(entity.begin(), entity.end(), pool.begin(), pool.end()));
 }
 
 TYPED_TEST(StorageNoInstance, SortUnordered) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    entt::entity entity[5u]{entt::entity{9}, entt::entity{7}, entt::entity{3}, entt::entity{12}, entt::entity{42}}; // NOLINT
+    std::array entity{entt::entity{4}, entt::entity{2}, entt::entity{1}, entt::entity{8}, entt::entity{16}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
     pool.sort(std::less{});
 
     ASSERT_EQ(pool.data()[0u], entity[4u]);
@@ -587,12 +588,12 @@ TYPED_TEST(StorageNoInstance, SortN) {
     using value_type = typename TestFixture::type;
     entt::storage<value_type> pool;
 
-    entt::entity entity[5u]{entt::entity{7}, entt::entity{9}, entt::entity{3}, entt::entity{12}, entt::entity{42}}; // NOLINT
+    std::array entity{entt::entity{2}, entt::entity{4}, entt::entity{1}, entt::entity{8}, entt::entity{16}};
 
-    pool.insert(std::begin(entity), std::end(entity));
+    pool.insert(entity.begin(), entity.end());
     pool.sort_n(0u, std::less{});
 
-    ASSERT_TRUE(std::equal(std::rbegin(entity), std::rend(entity), pool.begin(), pool.end()));
+    ASSERT_TRUE(std::equal(entity.rbegin(), entity.rend(), pool.begin(), pool.end()));
 
     pool.sort_n(2u, std::less{});
 
@@ -614,15 +615,15 @@ TYPED_TEST(StorageNoInstance, SortAsDisjoint) {
     entt::storage<value_type> lhs;
     const entt::storage<value_type> rhs;
 
-    entt::entity lhs_entity[3u]{entt::entity{3}, entt::entity{12}, entt::entity{42}}; // NOLINT
+    std::array entity{entt::entity{1}, entt::entity{2}, entt::entity{4}};
 
-    lhs.insert(std::begin(lhs_entity), std::end(lhs_entity));
+    lhs.insert(entity.begin(), entity.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(entity.rbegin(), entity.rend(), lhs.begin(), lhs.end()));
 
     lhs.sort_as(rhs.begin(), rhs.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(entity.rbegin(), entity.rend(), lhs.begin(), lhs.end()));
 }
 
 TYPED_TEST(StorageNoInstance, SortAsOverlap) {
@@ -630,14 +631,14 @@ TYPED_TEST(StorageNoInstance, SortAsOverlap) {
     entt::storage<value_type> lhs;
     entt::storage<value_type> rhs;
 
-    entt::entity lhs_entity[3u]{entt::entity{3}, entt::entity{12}, entt::entity{42}}; // NOLINT
-    entt::entity rhs_entity[1u]{entt::entity{12}};                                    // NOLINT
+    std::array lhs_entity{entt::entity{1}, entt::entity{2}, entt::entity{4}};
+    std::array rhs_entity{entt::entity{2}};
 
-    lhs.insert(std::begin(lhs_entity), std::end(lhs_entity));
-    rhs.insert(std::begin(rhs_entity), std::end(rhs_entity));
+    lhs.insert(lhs_entity.begin(), lhs_entity.end());
+    rhs.insert(rhs_entity.begin(), rhs_entity.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
-    ASSERT_TRUE(std::equal(std::rbegin(rhs_entity), std::rend(rhs_entity), rhs.begin(), rhs.end()));
+    ASSERT_TRUE(std::equal(lhs_entity.rbegin(), lhs_entity.rend(), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(rhs_entity.rbegin(), rhs_entity.rend(), rhs.begin(), rhs.end()));
 
     lhs.sort_as(rhs.begin(), rhs.end());
 
@@ -651,18 +652,18 @@ TYPED_TEST(StorageNoInstance, SortAsOrdered) {
     entt::storage<value_type> lhs;
     entt::storage<value_type> rhs;
 
-    entt::entity lhs_entity[5u]{entt::entity{1}, entt::entity{2}, entt::entity{3}, entt::entity{4}, entt::entity{5}};                  // NOLINT
-    entt::entity rhs_entity[6u]{entt::entity{6}, entt::entity{1}, entt::entity{2}, entt::entity{3}, entt::entity{4}, entt::entity{5}}; // NOLINT
+    std::array lhs_entity{entt::entity{1}, entt::entity{2}, entt::entity{4}, entt::entity{8}, entt::entity{16}};
+    std::array rhs_entity{entt::entity{32}, entt::entity{1}, entt::entity{2}, entt::entity{4}, entt::entity{8}, entt::entity{16}};
 
-    lhs.insert(std::begin(lhs_entity), std::end(lhs_entity));
-    rhs.insert(std::begin(rhs_entity), std::end(rhs_entity));
+    lhs.insert(lhs_entity.begin(), lhs_entity.end());
+    rhs.insert(rhs_entity.begin(), rhs_entity.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
-    ASSERT_TRUE(std::equal(std::rbegin(rhs_entity), std::rend(rhs_entity), rhs.begin(), rhs.end()));
+    ASSERT_TRUE(std::equal(lhs_entity.rbegin(), lhs_entity.rend(), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(rhs_entity.rbegin(), rhs_entity.rend(), rhs.begin(), rhs.end()));
 
     rhs.sort_as(lhs.begin(), lhs.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(rhs_entity), std::rend(rhs_entity), rhs.begin(), rhs.end()));
+    ASSERT_TRUE(std::equal(rhs_entity.rbegin(), rhs_entity.rend(), rhs.begin(), rhs.end()));
 }
 
 TYPED_TEST(StorageNoInstance, SortAsReverse) {
@@ -670,14 +671,14 @@ TYPED_TEST(StorageNoInstance, SortAsReverse) {
     entt::storage<value_type> lhs;
     entt::storage<value_type> rhs;
 
-    entt::entity lhs_entity[5u]{entt::entity{1}, entt::entity{2}, entt::entity{3}, entt::entity{4}, entt::entity{5}};                  // NOLINT
-    entt::entity rhs_entity[6u]{entt::entity{5}, entt::entity{4}, entt::entity{3}, entt::entity{2}, entt::entity{1}, entt::entity{6}}; // NOLINT
+    std::array lhs_entity{entt::entity{1}, entt::entity{2}, entt::entity{4}, entt::entity{8}, entt::entity{16}};
+    std::array rhs_entity{entt::entity{16}, entt::entity{8}, entt::entity{4}, entt::entity{2}, entt::entity{1}, entt::entity{32}};
 
-    lhs.insert(std::begin(lhs_entity), std::end(lhs_entity));
-    rhs.insert(std::begin(rhs_entity), std::end(rhs_entity));
+    lhs.insert(lhs_entity.begin(), lhs_entity.end());
+    rhs.insert(rhs_entity.begin(), rhs_entity.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
-    ASSERT_TRUE(std::equal(std::rbegin(rhs_entity), std::rend(rhs_entity), rhs.begin(), rhs.end()));
+    ASSERT_TRUE(std::equal(lhs_entity.rbegin(), lhs_entity.rend(), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(rhs_entity.rbegin(), rhs_entity.rend(), rhs.begin(), rhs.end()));
 
     rhs.sort_as(lhs.begin(), lhs.end());
 
@@ -694,14 +695,14 @@ TYPED_TEST(StorageNoInstance, SortAsUnordered) {
     entt::storage<value_type> lhs;
     entt::storage<value_type> rhs;
 
-    entt::entity lhs_entity[5u]{entt::entity{1}, entt::entity{2}, entt::entity{3}, entt::entity{4}, entt::entity{5}};                  // NOLINT
-    entt::entity rhs_entity[6u]{entt::entity{3}, entt::entity{2}, entt::entity{6}, entt::entity{1}, entt::entity{4}, entt::entity{5}}; // NOLINT
+    std::array lhs_entity{entt::entity{1}, entt::entity{2}, entt::entity{4}, entt::entity{8}, entt::entity{16}};
+    std::array rhs_entity{entt::entity{4}, entt::entity{2}, entt::entity{32}, entt::entity{1}, entt::entity{8}, entt::entity{16}};
 
-    lhs.insert(std::begin(lhs_entity), std::end(lhs_entity));
-    rhs.insert(std::begin(rhs_entity), std::end(rhs_entity));
+    lhs.insert(lhs_entity.begin(), lhs_entity.end());
+    rhs.insert(rhs_entity.begin(), rhs_entity.end());
 
-    ASSERT_TRUE(std::equal(std::rbegin(lhs_entity), std::rend(lhs_entity), lhs.begin(), lhs.end()));
-    ASSERT_TRUE(std::equal(std::rbegin(rhs_entity), std::rend(rhs_entity), rhs.begin(), rhs.end()));
+    ASSERT_TRUE(std::equal(lhs_entity.rbegin(), lhs_entity.rend(), lhs.begin(), lhs.end()));
+    ASSERT_TRUE(std::equal(rhs_entity.rbegin(), rhs_entity.rend(), rhs.begin(), rhs.end()));
 
     rhs.sort_as(lhs.begin(), lhs.end());
 

+ 69 - 67
test/entt/entity/view.cpp

@@ -1,4 +1,5 @@
 #include <algorithm>
+#include <array>
 #include <iterator>
 #include <tuple>
 #include <type_traits>
@@ -10,6 +11,7 @@
 #include <entt/entity/entity.hpp>
 #include <entt/entity/registry.hpp>
 #include <entt/entity/view.hpp>
+#include "../common/boxed_int.h"
 #include "../common/empty.h"
 #include "../common/pointer_stable.h"
 
@@ -168,18 +170,18 @@ TEST(SingleComponentView, ElementAccess) {
     auto cview = std::as_const(registry).view<const int>();
 
     const auto e0 = registry.create();
-    registry.emplace<int>(e0, 42); // NOLINT
+    registry.emplace<int>(e0, 4);
 
     const auto e1 = registry.create();
-    registry.emplace<int>(e1, 3);
+    registry.emplace<int>(e1, 1);
 
     for(auto i = 0u; i < view.size(); ++i) {
         ASSERT_EQ(view[i], i ? e0 : e1);  // NOLINT
         ASSERT_EQ(cview[i], i ? e0 : e1); // NOLINT
     }
 
-    ASSERT_EQ(view[e0], 42);
-    ASSERT_EQ(cview[e1], 3);
+    ASSERT_EQ(view[e0], 4);
+    ASSERT_EQ(cview[e1], 1);
 }
 
 TEST(SingleComponentView, Contains) {
@@ -210,7 +212,7 @@ TEST(SingleComponentView, Empty) {
 
 TEST(SingleComponentView, Each) {
     entt::registry registry;
-    const entt::entity entity[2]{registry.create(), registry.create()}; // NOLINT
+    const std::array entity{registry.create(), registry.create()};
 
     auto view = registry.view<int>(entt::exclude<double>);
     auto cview = std::as_const(registry).view<const int>();
@@ -418,16 +420,16 @@ TEST(SingleComponentView, FrontBack) {
 }
 
 TEST(SingleComponentView, DeductionGuide) {
-    entt::storage_type_t<int> istorage;                  // NOLINT
-    entt::storage_type_t<test::pointer_stable> sstorage; // NOLINT
+    using int_storage = entt::storage_type_t<int>;
+    using stable_storage = entt::storage_type_t<test::pointer_stable>;
 
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{istorage})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::as_const(istorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{sstorage})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<int_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<const int_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<stable_storage &>()})>();
 
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(istorage), std::make_tuple()})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::as_const(istorage))})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(sstorage)})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>()), std::make_tuple()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<const int_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<stable_storage &>())})>();
 }
 
 TEST(SingleComponentView, IterableViewAlgorithmCompatibility) {
@@ -547,7 +549,7 @@ TEST(SingleComponentView, SwapStorage) {
     ASSERT_EQ(view.storage<0u>(), nullptr);
     ASSERT_EQ(cview.storage<const int>(), nullptr);
 
-    const entt::entity entity{42u};
+    const entt::entity entity{4u};
     registry.emplace<int>(entity);
 
     view.storage(registry.storage<int>());
@@ -609,7 +611,7 @@ TEST(MultiComponentView, Functionalities) {
     registry.emplace<char>(e0, '1');
 
     const auto e1 = registry.create();
-    registry.emplace<int>(e1, 42); // NOLINT
+    registry.emplace<int>(e1, 4);
     registry.emplace<char>(e1, '2');
 
     ASSERT_EQ(*view.begin(), e1);
@@ -625,8 +627,8 @@ TEST(MultiComponentView, Functionalities) {
     ASSERT_EQ(view.size_hint(), 1u);
 
     for(auto entity: view) {
-        ASSERT_EQ(std::get<0>(cview.get<const int, const char>(entity)), 42);
-        ASSERT_EQ(std::get<0>(cview.get<0u, 1u>(entity)), 42);
+        ASSERT_EQ(std::get<0>(cview.get<const int, const char>(entity)), 4);
+        ASSERT_EQ(std::get<0>(cview.get<0u, 1u>(entity)), 4);
 
         ASSERT_EQ(std::get<1>(view.get<int, char>(entity)), '2');
         ASSERT_EQ(std::get<1>(view.get<0u, 1u>(entity)), '2');
@@ -772,10 +774,10 @@ TEST(MultiComponentView, LazyExcludedTypeFromConstRegistry) {
 
 TEST(MultiComponentView, Iterator) {
     entt::registry registry;
-    const entt::entity entity[2]{registry.create(), registry.create()}; // NOLINT
+    const std::array entity{registry.create(), registry.create()};
 
-    registry.insert<int>(std::begin(entity), std::end(entity));
-    registry.insert<char>(std::begin(entity), std::end(entity));
+    registry.insert<int>(entity.begin(), entity.end());
+    registry.insert<char>(entity.begin(), entity.end());
 
     const auto view = registry.view<int, char>();
     using iterator = typename decltype(view)::iterator;
@@ -804,15 +806,15 @@ TEST(MultiComponentView, ElementAccess) {
     auto cview = std::as_const(registry).view<const int, const char>();
 
     const auto e0 = registry.create();
-    registry.emplace<int>(e0, 42); // NOLINT
+    registry.emplace<int>(e0, 4);
     registry.emplace<char>(e0, '0');
 
     const auto e1 = registry.create();
-    registry.emplace<int>(e1, 3);
+    registry.emplace<int>(e1, 1);
     registry.emplace<char>(e1, '1');
 
-    ASSERT_EQ(view[e0], std::make_tuple(42, '0'));
-    ASSERT_EQ(cview[e1], std::make_tuple(3, '1'));
+    ASSERT_EQ(view[e0], std::make_tuple(4, '0'));
+    ASSERT_EQ(cview[e1], std::make_tuple(1, '1'));
 }
 
 TEST(MultiComponentView, Contains) {
@@ -853,7 +855,7 @@ TEST(MultiComponentView, SizeHint) {
 
 TEST(MultiComponentView, UseAndRefresh) {
     entt::registry registry;
-    const entt::entity entity[3]{registry.create(), registry.create(), registry.create()}; // NOLINT
+    const std::array entity{registry.create(), registry.create(), registry.create()};
 
     registry.emplace<int>(entity[0u]);
     registry.emplace<int>(entity[1u]);
@@ -883,7 +885,7 @@ TEST(MultiComponentView, UseAndRefresh) {
 
 TEST(MultiComponentView, Each) {
     entt::registry registry;
-    const entt::entity entity[2]{registry.create(), registry.create()}; // NOLINT
+    const std::array entity{registry.create(), registry.create()};
 
     auto view = registry.view<int, char>(entt::exclude<double>);
     auto cview = std::as_const(registry).view<const int, const char>();
@@ -945,7 +947,7 @@ TEST(MultiComponentView, EachWithSuggestedType) {
 
     // makes char a better candidate during iterations
     const auto entity = registry.create();
-    registry.emplace<int>(entity, 99); // NOLINT
+    registry.emplace<int>(entity, 3);
 
     view.use<int>();
     view.each([value = 2](const auto curr, const auto) mutable {
@@ -993,21 +995,21 @@ TEST(MultiComponentView, EachWithHoles) {
     registry.emplace<char>(e0, '0');
     registry.emplace<char>(e1, '1');
 
-    registry.emplace<int>(e0, 0);
-    registry.emplace<int>(e2, 2);
+    registry.emplace<test::boxed_int>(e0, 0);
+    registry.emplace<test::boxed_int>(e2, 2);
 
-    auto view = registry.view<char, int>();
+    auto view = registry.view<char, test::boxed_int>();
 
-    view.each([e0](auto entity, const char &c, const int &i) { // NOLINT
+    view.each([e0](auto entity, const char &c, const test::boxed_int &i) {
         ASSERT_EQ(entity, e0);
         ASSERT_EQ(c, '0');
-        ASSERT_EQ(i, 0);
+        ASSERT_EQ(i.value, 0);
     });
 
     for(auto &&curr: view.each()) {
         ASSERT_EQ(std::get<0>(curr), e0);
         ASSERT_EQ(std::get<1>(curr), '0');
-        ASSERT_EQ(std::get<2>(curr), 0);
+        ASSERT_EQ(std::get<2>(curr).value, 0);
     }
 }
 
@@ -1258,27 +1260,27 @@ TEST(MultiComponentView, ExtendedGet) {
 }
 
 TEST(MultiComponentView, DeductionGuide) {
-    entt::storage_type_t<int> istorage;                  // NOLINT
-    entt::storage_type_t<double> dstorage;               // NOLINT
-    entt::storage_type_t<test::pointer_stable> sstorage; // NOLINT
-
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{istorage, dstorage})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::as_const(istorage), dstorage})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{istorage, std::as_const(dstorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::as_const(istorage), std::as_const(dstorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{istorage, sstorage})>();
-
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(istorage, dstorage), std::make_tuple()})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::as_const(istorage), dstorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(istorage, std::as_const(dstorage))})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::as_const(istorage), std::as_const(dstorage))})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(istorage, sstorage)})>();
-
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(istorage), std::forward_as_tuple(dstorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::as_const(istorage)), std::forward_as_tuple(dstorage)})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<const entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(istorage), std::forward_as_tuple(std::as_const(dstorage))})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<const entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::as_const(istorage)), std::forward_as_tuple(std::as_const(dstorage))})>();
-    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<test::pointer_stable>>>, decltype(entt::basic_view{std::forward_as_tuple(istorage), std::forward_as_tuple(sstorage)})>();
+    using int_storage = entt::storage_type_t<int>;
+    using double_storage = entt::storage_type_t<double>;
+    using stable_storage = entt::storage_type_t<test::pointer_stable>;
+
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<int_storage &>(), std::declval<double_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<const int_storage &>(), std::declval<double_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<int_storage &>(), std::declval<const double_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<const int_storage &>(), std::declval<const double_storage &>()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::declval<int_storage &>(), std::declval<stable_storage &>()})>();
+
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>(), std::declval<double_storage &>()), std::make_tuple()})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<const int_storage &>(), std::declval<double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>(), std::declval<const double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>, const entt::storage_type_t<double>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<const int_storage &>(), std::declval<const double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>, entt::storage_type_t<test::pointer_stable>>, entt::exclude_t<>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>(), std::declval<stable_storage &>())})>();
+
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>()), std::forward_as_tuple(std::declval<double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<const int_storage &>()), std::forward_as_tuple(std::declval<double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<const entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>()), std::forward_as_tuple(std::declval<const double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<const entt::storage_type_t<int>>, entt::exclude_t<const entt::storage_type_t<double>>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<const int_storage &>()), std::forward_as_tuple(std::declval<const double_storage &>())})>();
+    testing::StaticAssertTypeEq<entt::basic_view<entt::get_t<entt::storage_type_t<int>>, entt::exclude_t<entt::storage_type_t<test::pointer_stable>>>, decltype(entt::basic_view{std::forward_as_tuple(std::declval<int_storage &>()), std::forward_as_tuple(std::declval<stable_storage &>())})>();
 }
 
 TEST(MultiComponentView, IterableViewAlgorithmCompatibility) {
@@ -1351,7 +1353,7 @@ TEST(MultiComponentView, StableTypeWithExcludedComponent) {
     const auto other = registry.create();
 
     registry.emplace<test::pointer_stable>(entity, 0);
-    registry.emplace<test::pointer_stable>(other, 42); // NOLINT
+    registry.emplace<test::pointer_stable>(other, 4);
     registry.emplace<int>(entity);
 
     ASSERT_EQ(view.size_hint(), 2u);
@@ -1374,7 +1376,7 @@ TEST(MultiComponentView, StableTypeWithExcludedComponent) {
         constexpr entt::entity tombstone = entt::tombstone;
         ASSERT_NE(entt, tombstone);
         ASSERT_EQ(entt, other);
-        ASSERT_EQ(comp.value, 42);
+        ASSERT_EQ(comp.value, 4);
     }
 
     view.each([other](const auto entt, auto &&...) {
@@ -1393,18 +1395,18 @@ TEST(MultiComponentView, SameComponentTypes) {
     storage.bind(entt::forward_as_any(registry));
     other.bind(entt::forward_as_any(registry));
 
-    const entt::entity e0{42u};
-    const entt::entity e1{3u};
+    const entt::entity e0{4u};
+    const entt::entity e1{1u};
 
-    storage.emplace(e0, 7); // NOLINT
-    other.emplace(e0, 9);   // NOLINT
+    storage.emplace(e0, 2);
+    other.emplace(e0, 3);
     other.emplace(e1, 1);
 
     ASSERT_TRUE(view.contains(e0));
     ASSERT_FALSE(view.contains(e1));
 
-    ASSERT_EQ((view.get<0u, 1u>(e0)), (std::make_tuple(7, 9)));
-    ASSERT_EQ(view.get<1u>(e0), 9);
+    ASSERT_EQ((view.get<0u, 1u>(e0)), (std::make_tuple(2, 3)));
+    ASSERT_EQ(view.get<1u>(e0), 3);
 
     for(auto entt: view) {
         ASSERT_EQ(entt, e0);
@@ -1412,14 +1414,14 @@ TEST(MultiComponentView, SameComponentTypes) {
 
     view.each([&](auto entt, auto &&first, auto &&second) {
         ASSERT_EQ(entt, e0);
-        ASSERT_EQ(first, 7);
-        ASSERT_EQ(second, 9);
+        ASSERT_EQ(first, 2);
+        ASSERT_EQ(second, 3);
     });
 
     for(auto [entt, first, second]: view.each()) {
         ASSERT_EQ(entt, e0);
-        ASSERT_EQ(first, 7);
-        ASSERT_EQ(second, 9);
+        ASSERT_EQ(first, 2);
+        ASSERT_EQ(second, 3);
     }
 
     ASSERT_EQ(view.handle(), &storage);
@@ -1512,7 +1514,7 @@ TEST(MultiComponentView, SwapStorage) {
     ASSERT_EQ(view.storage<0u>(), nullptr);
     ASSERT_EQ(view.storage<const char>(), nullptr);
 
-    const entt::entity entity{42u};
+    const entt::entity entity{4u};
     registry.emplace<int>(entity);
     registry.emplace<char>(entity);
 

Some files were not shown because too many files changed in this diff