1

I'm working on a Entity Component System library with a little part of meta programming. There I have to manage two kind of type : Component type and Manager (data storage) type.

A manager is policies design based and I don't know how many policies they are going to use. A manager can be associated with one or several component.

I have a tuple which contain every component type:

template < typename T >
struct FooType {

  using type = T;
};

constexpr auto Components = std::make_tuple(FooType<Foo1>{}, FooType<Foo2>{});

So I was going to begin with something like this :

template < typename T >
concept bool existingComponent() {
  return true;
}

template < typename ... existingComponent,
           typename ... Policies >
constexpr auto  make_type_pack() {
...
}

So I have to replace true in the concept by a constexpr function which will have to look if the type is inside Components. Is that even legal? Sorry I'm new at meta programming and concepts.

Mathieu Van Nevel
  • 1,428
  • 1
  • 10
  • 26

0 Answers0