EntityComponentMetaSystem/src/test/WillFailCompileTest.cpp
Stephen Seo 8c462b83a1 Add static_assert, components must be def-const
EC::Manager will fail to compile if any given Component is not default
constructible, so a static_assert and ctest was added.
2018-09-11 12:16:04 +09:00

25 lines
336 B
C++

#include <EC/Manager.hpp>
struct NoDef
{
NoDef(int a) : a(a) {}
int a;
};
struct WithDef
{
WithDef() : a(0) {}
int a;
};
using EC::Meta::TypeList;
int main()
{
// should fail to compile because "NoDef" is not default constructible
EC::Manager<TypeList<WithDef, NoDef>, TypeList<>> manager;
return 0;
}