c++/boost: use tuple ctors when subclassing
is there some way to use a boost tuple's ctors as an addition to the subclass methods (and ctors) like here?
// typedef boost::tuple<int, SomeId, SomeStatus> Conn;
// Conn(1); // works and initializes using default ctors of Some*
struct Conn : boost::tuple<int, A开发者_如何转开发synchId, AccDevRetStatus> {};
Conn(1); // "no matching function call" (but i want it so much)
T.H.X.
You have to define all constructors yourself and forward to the base class.
Note that you can create a typedef instead.
typedef boost::tuple<int, AsynchId, AccDevRetStatus> Conn;
精彩评论