Weird (unintuitive?) behavior of std::tuple

Paolo Carlini paolo.carlini@oracle.com
Sun Oct 31 13:51:00 GMT 2010


On 10/31/2010 12:52 PM, Alex Dubov wrote:
> Indeed, the behavior of pair is identical (and, as such, counter-
> intuitive). pair<B, C> xx(B(), C()) won't invoke the constructors at all,
> just like tuple (but will invoke the non-default ones, if those were
> specified).
>   
Did you actually try to compile the snippet I proposed? Did you pay
attention to the error message? I suspect you are still a bit confused
about the actual semantics of the line above.

Paolo.



More information about the Libstdc++ mailing list