Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2007-07-26 02:53:50


Zeljko Vrba wrote:
> On Thu, Jul 26, 2007 at 11:16:08AM +1200, Richard Dingwall wrote:
>> Pardon me if it's just a two-dimensional example for simplicity, but why not
>> use std::pair?
>>
> Orthogonality. Personally, I'd find it very cumbersome to make an
> exception for pairs and write t.first, t.second when I write t.get<N>()
> for larger tuples. Plus, if the tuple should grow at some point,
> you'd have to fix all occurences of .first and .second.
>
> However, I have another question regarding tuples: the debugger expands
> tuple<X1,X2,X3> to tuple<X1,X2,X3,null_type,null_type,...> [a large list
> of null_types in the template]. Do these null_types take space in the
> tuple, and do they slow down passing by value (due to unneccessary
> copying of null_type)?

No they don't (take space in the tuple, and do they slow down
passing by value).

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net