test: boxed_int -> boxed_type
This commit is contained in:
1
TODO
1
TODO
@@ -27,6 +27,5 @@ TODO:
|
||||
* review assure conflicts check, hash doesn't fit the purpose maybe
|
||||
* allow to zero-sized versions (with non-regression tests)
|
||||
* auto type info data from types if present
|
||||
* boxed_int -> boxed_type with known specializations
|
||||
* sparse set sort_as should return the length to be a proper drop-in replacement for pack (then review registry destroy)
|
||||
* group review: use handler as base with protected members and arrays of common type (see view for further details)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#ifndef ENTT_COMMON_BOXED_INT_H
|
||||
#define ENTT_COMMON_BOXED_INT_H
|
||||
|
||||
namespace test {
|
||||
|
||||
struct boxed_int {
|
||||
int value{};
|
||||
};
|
||||
|
||||
inline bool operator==(const boxed_int &lhs, const boxed_int &rhs) {
|
||||
return lhs.value == rhs.value;
|
||||
}
|
||||
|
||||
} // namespace test
|
||||
|
||||
#endif
|
||||
20
test/entt/common/boxed_type.h
Normal file
20
test/entt/common/boxed_type.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef ENTT_COMMON_BOXED_TYPE_H
|
||||
#define ENTT_COMMON_BOXED_TYPE_H
|
||||
|
||||
namespace test {
|
||||
|
||||
template<typename Type>
|
||||
struct boxed_type {
|
||||
Type value{};
|
||||
};
|
||||
|
||||
template<typename Type>
|
||||
inline bool operator==(const boxed_type<Type> &lhs, const boxed_type<Type> &rhs) {
|
||||
return lhs.value == rhs.value;
|
||||
}
|
||||
|
||||
using boxed_int = boxed_type<int>;
|
||||
|
||||
} // namespace test
|
||||
|
||||
#endif
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <vector>
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/core/algorithm.hpp>
|
||||
#include "../common/boxed_int.h"
|
||||
#include "../common/boxed_type.h"
|
||||
|
||||
TEST(Algorithm, StdSort) {
|
||||
// well, I'm pretty sure it works, it's std::sort!!
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <vector>
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/core/iterator.hpp>
|
||||
#include "../common/boxed_int.h"
|
||||
#include "../common/boxed_type.h"
|
||||
|
||||
TEST(InputIteratorPointer, Functionalities) {
|
||||
entt::input_iterator_pointer ptr{test::boxed_int{0}};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/config/config.h>
|
||||
#include <entt/entity/component.hpp>
|
||||
#include "../common/boxed_int.h"
|
||||
#include "../common/boxed_type.h"
|
||||
#include "../common/empty.h"
|
||||
#include "../common/non_movable.h"
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/entity/group.hpp>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "../common/boxed_int.h"
|
||||
#include "../common/boxed_type.h"
|
||||
#include "../common/config.h"
|
||||
#include "../common/empty.h"
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <entt/entity/entity.hpp>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include <entt/entity/view.hpp>
|
||||
#include "../common/boxed_int.h"
|
||||
#include "../common/boxed_type.h"
|
||||
#include "../common/empty.h"
|
||||
#include "../common/pointer_stable.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user