开发者

How to add elements to a Boost.Tuple

Maybe this is a simple question, but I can't figure it out how can I add开发者_如何学运维 elements to a tuple. What I want is to iterate a vector and add every element into a tuple:

for(it = vector.begin(); it != vector.end(); ++it)
{
   tuple.addElement(*it);
}

I dont see any specific method to add elements.

Thanks for helping.


You don't "add elements" to a tuple. A tuple is not a container.

Sounds like perhaps you're looking for a std::vector, or perhaps some other container.


You cannot. The size of the tuple is fixed and the element you want to access must be known at compile time.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜