Stephen Seo
8c462b83a1
EC::Manager will fail to compile if any given Component is not default constructible, so a static_assert and ctest was added.
24 lines
336 B
C++
24 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;
|
|
}
|