Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 1999-11-21 04:54:06


Greg Colvin wrote:

> That is, given an inlined constructor
>
> struct X { T t; X(T t):t(t){} };
>
> is the compiler required to make a copy of the T parameter, or can it assign
> the T argument directly to the T member? That is, in the statement
>
> X x(t);
>
> is the compiler allowed to copy t only once, or must it first push it on
> the stack?

The compiler must copy t twice. t, t and t must be three different
objects.

-- 
Valentin Bonnard

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk