meta: rollback factory setup support to get wip in e healthy state (damn MSVC that accepts everything)
This commit is contained in:
@@ -176,19 +176,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Invokes a meta setup function for the current factory, if any.
|
||||
*
|
||||
* @warning
|
||||
* The factory is provided in its current state and is not reinitialized.
|
||||
*
|
||||
* @return A meta factory for the parent type.
|
||||
*/
|
||||
meta_factory setup() noexcept {
|
||||
meta_setup(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Assigns a meta base to a meta type.
|
||||
*
|
||||
|
||||
@@ -61,26 +61,6 @@ private:
|
||||
bool *cb;
|
||||
};
|
||||
|
||||
namespace test {
|
||||
|
||||
template<typename Type>
|
||||
// concept-like approach (waiting for C++20 and concepts)
|
||||
static auto meta_setup(entt::meta_factory<Type> factory) -> decltype(&Type::value, void()) {
|
||||
using namespace entt::literals;
|
||||
factory.template data<&Type::value>("value"_hs).template conv<decltype(Type::value)>();
|
||||
}
|
||||
|
||||
static void meta_setup(entt::meta_factory<test::boxed_int> factory) {
|
||||
using namespace entt::literals;
|
||||
factory.data<&test::boxed_int::value>("value"_hs);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
inline void meta_setup(...) {
|
||||
ENTT_FAIL("oops");
|
||||
}
|
||||
|
||||
struct MetaFactory: ::testing::Test {
|
||||
void TearDown() override {
|
||||
entt::meta_reset();
|
||||
@@ -138,23 +118,6 @@ ENTT_DEBUG_TEST_F(MetaFactoryDeathTest, Type) {
|
||||
ASSERT_DEATH(other.type("foo"_hs), "");
|
||||
}
|
||||
|
||||
TEST_F(MetaFactory, Setup) {
|
||||
using namespace entt::literals;
|
||||
|
||||
entt::meta_factory<test::boxed_int>{}.setup();
|
||||
entt::meta_factory<test::boxed_char>{}.setup();
|
||||
|
||||
ASSERT_TRUE(entt::resolve<test::boxed_int>().data("value"_hs));
|
||||
ASSERT_TRUE(entt::resolve<test::boxed_char>().data("value"_hs));
|
||||
|
||||
ASSERT_FALSE(entt::resolve<test::boxed_int>().can_convert(entt::resolve<int>()));
|
||||
ASSERT_TRUE(entt::resolve<test::boxed_char>().can_convert(entt::resolve<char>()));
|
||||
}
|
||||
|
||||
ENTT_DEBUG_TEST_F(MetaFactoryDeathTest, Setup) {
|
||||
ASSERT_DEATH(entt::meta_factory<int>{}.setup(), "");
|
||||
}
|
||||
|
||||
TEST_F(MetaFactory, Base) {
|
||||
entt::meta_factory<clazz> factory{};
|
||||
decltype(std::declval<entt::meta_type>().base()) range{};
|
||||
|
||||
Reference in New Issue
Block a user