2

I have a set of classes like

class A { void Do(int&); }
class B { void Do(char&); }
some more...

Is it possible to connect these classes by a variadic template like this:

template <typename ...T>
class ConnectIt: public T...
{
    using T ...::Do; // this expression fails.
                     // Some hints to get a set of using 
                     // expressions from parameter pack?
};

Instantiate with something like:

Class MyOne: public ConnectIt<A,B> {} my;
int i;
char c;    

my.Do(i);
my.Do(c);
Andy Prowl
  • 124,023
  • 23
  • 387
  • 451
Klaus
  • 24,205
  • 7
  • 58
  • 113

0 Answers0