Typelist - GerdHirsch/Cpp-VisitorFrameworkCyclicAcyclic GitHub Wiki
Typelist is a non defined template, just to specialize another templates:
template<class ...Types>
struct Typelist;
For example, MyVisitor : visits<typelist>
can be used with a typelist, because of specialization:
template<class ...ToVisit>
struct visits : VisitorBase{};
template<class ...ToVisit>
struct visits<VisitorFramework::Typelist<ToVisit...>>
// delegates to primary DRY Principle
: visits<ToVisit...>{};
Both implementations of visits
delegates their implementations to their base class. The specialization to the primary and the primary template to VisitorBase
thereby discarding the list in case of the cyclic Repository
.
Typelist
is very useful and often used i.e. by
Repository
of the framework.