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 an A
object and a B
object, so they have to be copied from the arguments.
If you want a tuple of references, use boost::tie(objA, objB)
instead, which returns a boost::tuple<A&, B&>
.