|
@@ -4,6 +4,14 @@
|
|
|
#include <entt/meta/pointer.hpp>
|
|
#include <entt/meta/pointer.hpp>
|
|
|
#include <entt/meta/resolve.hpp>
|
|
#include <entt/meta/resolve.hpp>
|
|
|
|
|
|
|
|
|
|
+struct not_copyable_t {
|
|
|
|
|
+ not_copyable_t() = default;
|
|
|
|
|
+ not_copyable_t(const not_copyable_t &) = delete;
|
|
|
|
|
+ not_copyable_t(not_copyable_t &&) = default;
|
|
|
|
|
+ not_copyable_t & operator=(const not_copyable_t &) = delete;
|
|
|
|
|
+ not_copyable_t & operator=(not_copyable_t &&) = default;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
TEST(MetaPointerLike, DereferenceOperatorInvalidType) {
|
|
TEST(MetaPointerLike, DereferenceOperatorInvalidType) {
|
|
|
int value = 0;
|
|
int value = 0;
|
|
|
entt::meta_any any{value};
|
|
entt::meta_any any{value};
|
|
@@ -79,3 +87,11 @@ TEST(MetaPointerLike, DereferenceOperatorSmartPointer) {
|
|
|
ASSERT_EQ(*any.cast<std::shared_ptr<int>>(), 42);
|
|
ASSERT_EQ(*any.cast<std::shared_ptr<int>>(), 42);
|
|
|
ASSERT_EQ(*value, 42);
|
|
ASSERT_EQ(*value, 42);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+TEST(MetaPointerLike, PointerToMoveOnlyType) {
|
|
|
|
|
+ const not_copyable_t instance;
|
|
|
|
|
+ entt::meta_any any{&instance};
|
|
|
|
|
+
|
|
|
|
|
+ ASSERT_TRUE(any);
|
|
|
|
|
+ ASSERT_FALSE(*any);
|
|
|
|
|
+}
|