Describe the bug
Importing the 'flecs::stats' module before the 'flecs::units' module results in an error message when trying to register a component member as having a given Unit type.
To Reproduce
Consider the following code:
#include <flecs.h>
int main() {
flecs::world world;
world.import<flecs::stats>();
world.import<flecs::units>();
struct Foo {
float x;
};
world.component<Foo>().member<flecs::units::length::Meters>("x", &Foo::x);
return 0;
}
Running that code emits the following:
error: meta.c: 392: entity 'Meters' for member 'x' is not a unit
Swapping the order of those two imports fixes the issue.
NB: This is running on v4.0.0 of flecs.
Describe the bug
Importing the 'flecs::stats' module before the 'flecs::units' module results in an error message when trying to register a component member as having a given Unit type.
To Reproduce
Consider the following code:
Running that code emits the following:
Swapping the order of those two imports fixes the issue.
NB: This is running on v4.0.0 of flecs.