4 ms·
The kind of stuff you are able to do with entt (https://github.com/skypjack/entt#code-example https://github.com/skypjack/entt#code-example) like `entities.view
by nikki93 6y ago
The kind of stuff you are able to do with entt (https://github.com/skypjack/entt#code-example https://github.com/skypjack/entt#code-example) like `entities.view<Position, Sprite>.each([&](auto &pos, auto &vel) { ... });` is super awesome IMO. And then it compiles down to just directly inlined straight walks over the respective arrays (looking in godbolt.org). It's basically almost optimal for it.
I do agree that you can go insane with templates and have a bad time. You just have to choose well. However if you have a problem with there existing other problematic code in the same language (that may be separate from your code), then C++ is maybe not the best fit. There's a lot of C++ out there.