0

I have take the below example from Template with Multiple pack as input parameter.

#include <iostream>
#include <tuple>

// A template to hold a parameter pack.                                                                                                                                                                                                                                                                                                                                                       
template < typename... >
struct Typelist {};

// Declaration of a template with multiple parameter pack.                                                                                                                                                                                                                                                                                                                                    
template< typename TypeListOne                                                                                                                                                                                                                                                                                                                                                                
        , typename TypeListTwo                                                                                                                                                                                                                                                                                                                                                                
        >                                                                                                                                                                                                                                                                                                                                                                                     
struct SomeStruct;

// Specialization of template with multiple parameter packs                                                                                                                                                                                                                                                                                                                                   
template< typename... TypesOne
        , typename... TypesTwo
        >
struct SomeStruct< Typelist < TypesOne... >
                 , Typelist < TypesTwo... >
                 >
{
    // Can use TypesOne... and TypesTwo... how ever                                                                                                                                                                                                                                                                                                                                           
    // you want here. For example:                                                                                                                                                                                                                                                                                                                                                            
    typedef std::tuple< TypesOne... > TupleTypeOne;
    typedef std::tuple< TypesTwo... > TupleTypeTwo;
};

I would like to know how to instantiate object of SomeStruct.

UnSat
  • 1,347
  • 2
  • 14
  • 28

1 Answers1

1

For example:

SomeStruct <Typelist <char, int, char>,
            Typelist <int, double>> var;
Jarod42
  • 203,559
  • 14
  • 181
  • 302