开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜