Typelist of nested types
05:21 20 Jul 2022

I've got a typelist providing the following interface :

 template 
    struct type_list
    {
        static constexpr size_t length = sizeof...(Ts);

        template 
        using push_front = type_list;


        template 
        using push_back = type_list;
        
        // hidden implementation of complex "methods"

        template 
        using at;

        struct pop_front;

        template 
        using concat;

        template 
        struct split;

        template 
        using insert;

        template 
        using remove;
    };

In another piece of code, I have such a typelist TL of types statically inheriting a base class providing such an interface :

template
struct Expression {
   using type1 = typename Derived::_type1;
   using type2 = typename Derived::_type2;
};

struct Exp1 : Expression {
    template friend struct Expression;
    private:
    using _type1 = float;
    using _type2 = int;
};

struct Exp2 : Expression {
    template friend struct Expression;
    private:
    using _type1 = double;
    using _type2 = short;
};

I want to make the typelist of nested types from TL, something like :

using TL = type_list;
using TL2 = type_list; // type_list

but I can't expand TL as it's not an unexpanded parameter pack.

I've thought about index_sequence but can't manage to make it work.

c++ template-meta-programming typelist