I have something like this in my code
val = boost::make_tuple(objA , objB);
My question is does boost::make_tuple make copies of objA and objB ?
I have something like this in my code
val = boost::make_tuple(objA , objB);
My question is does boost::make_tuple make copies of objA and objB ?
Yes, the returned object is a
boost::tuple<A, B>which contains anAobject and aBobject, so they have to be copied from the arguments.If you want a tuple of references, use
boost::tie(objA, objB)instead, which returns aboost::tuple<A&, B&>.