I’m experimenting with creation of my own ECS in C++, and I got an idea to have some kind of compile time type registry(basically a types list) from which i can later create a tuple of my systems. The idea is to have a compile time errors, not runtime, for example if system was not registered but I’m trying to get it etc.
I see it like this:
#include <tuple>
template<typename T>
void registerSystem()
{
//implementation???
}
int main() {
registerSystem<int>();
registerSystem<float>();
registerSystem<double>();
// all "registerSystem" calls should create
// smth like types list
std::tuple<SmthLikeTypeList> systems;
return 0;
}
So either there is a types list somewhere which i can extend in compile time with registerSystem
calls or maybe it is possible to extend the tuple directly?
Tried to overwrite empty types list with extended version, tried the same with tuple, but maybe because it’s impossible, i cannot get it to work 🙂
Dmytro Shalimov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.