Replies: 1 comment
-
|
Turning this into a doc issue to fix for clarity. 👍 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The https://github.com/skypjack/entt/wiki/Entity-Component-System states:
" A context variable must be both default constructible and movable. "
This doesn't seem accurate. The following compiles and runs fine with a deleted default constructor:
struct Test
{
Test() = delete;
Test(int value) : testValue(value) {}
int testValue = 0;
};
entt::registry registry;
registry.ctx().emplace<Test>(42);
std::cout << registry.ctx().get<Test>().testValue << std::endl; // prints 42
But it seems to me the default constructibility requirement only applies when a type is used as a context variable through
entt::organizer (i.e. as a system function parameter)?
Beta Was this translation helpful? Give feedback.
All reactions