diff --git a/PolyEngine/Core/Src/pe/core/rtti/RTTI2.cpp b/PolyEngine/Core/Src/pe/core/rtti/RTTI2.cpp index adb0ea95..0686e01a 100644 --- a/PolyEngine/Core/Src/pe/core/rtti/RTTI2.cpp +++ b/PolyEngine/Core/Src/pe/core/rtti/RTTI2.cpp @@ -4,10 +4,10 @@ namespace pe::core::rtti { namespace RTTI2 { - TypeManager& get() + TypeManager& TypeManager::get() { static TypeManager instance{}; return instance; } } -} \ No newline at end of file +} diff --git a/PolyEngine/Core/Src/pe/core/rtti/RTTI2.hpp b/PolyEngine/Core/Src/pe/core/rtti/RTTI2.hpp index 0e4c590a..8f608bd9 100644 --- a/PolyEngine/Core/Src/pe/core/rtti/RTTI2.hpp +++ b/PolyEngine/Core/Src/pe/core/rtti/RTTI2.hpp @@ -17,19 +17,19 @@ namespace pe::core::rtti namespace impl { + template + void runListImpl(F f, X x) { f(x); } + template - void runList(F f, X x, XS... xs) + void runListImpl(F f, X x, XS... xs) { f(x); - runList(f, xs...); + runListImpl(f, xs...); } - - template - void runList(F f, X x) { f(x); } } constexpr auto runList = [](auto list, auto f) { - list([f](auto... xs){ impl::runList(f, xs...); }); + list([f](auto... xs){ impl::runListImpl(f, xs...); }); }; namespace RTTI2 diff --git a/PolyEngine/UnitTests/Src/RTTI2Test.cpp b/PolyEngine/Tests/CoreTests/Src/RTTI2Test.cpp similarity index 94% rename from PolyEngine/UnitTests/Src/RTTI2Test.cpp rename to PolyEngine/Tests/CoreTests/Src/RTTI2Test.cpp index 7965ef97..704c957c 100644 --- a/PolyEngine/UnitTests/Src/RTTI2Test.cpp +++ b/PolyEngine/Tests/CoreTests/Src/RTTI2Test.cpp @@ -10,7 +10,7 @@ struct TestClass : public virtual RTTI2::RTTIBase { TestClass() : RTTI2::RTTIBase(RTTI2::TypeManager::get().registerOrGetType()) {} }; template <> struct RTTI2::RTTIinfo { - constexpr static auto info = List(testAttr, testAttr, RTTI2::classname{ "testname" }); + constexpr static auto info = List(testAttr, testAttr, RTTI2::ClassName{ "testname" }); }; TEST_CASE("RTTI2 simple attribute", "[RTTI2]") { @@ -20,7 +20,7 @@ TEST_CASE("RTTI2 simple attribute", "[RTTI2]") { CHECK(ta); CHECK(ta->size() == 2); CHECK(tc.typeInfo().get() == nullptr); - auto x = tc.typeInfo().get(); + auto x = tc.typeInfo().get(); CHECK(x); CHECK(std::string("testname") == x->name); } @@ -73,4 +73,4 @@ TEST_CASE("RTTI2 derived", "[RTTI2]") { CHECK(tcb.typeInfo().bases[0].get().id == tca.typeInfo().id); CHECK(RTTI2::isSame(tca.typeInfo())); CHECK(RTTI2::isDerived(tcb.typeInfo())); -} \ No newline at end of file +}