So I have been running into a problem with CRTP and inheritance, to sketch a rough illustration I have something like this I want to achieve:
template <typename ChildType> class Base {std::vector<ChildType*> childeren;}
template <typename Derived> class Foo : public Base<Foo>{ Derived* func() {return (Derived*)this;} };
class Bar : public Foo<Bar>{};
Hover this doesn't compile as I can't use Foo as the template argument for Base as Foo alone is an incomplete template argument. I could solve this by simply passing in derived, but then this restricts the ChildTypes to much and it would also never allow me to instantiate a stand alone Foo type what is also a requirment I have.
So any ideas on how I can solve this would be much appreciated. ofcource, if you need any more details let me know.