|
Boost : |
From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2004-01-09 19:30:50
Dan W. wrote:
> Daniel Wallin wrote:
>
>> Yes. At least if:
>>
>>> struct base {};
>>> struct derived {};
>
> indeed, that was a typo
>
>>
>> ^^^^^^^ is derived from base
>>
>>>
>>> derived make_temp_derived(){ return derived; }
>>> //scope..
>>> {
>>> base const & b = make_temp_derived();
>>> ...
>>> } <- the created temporary should last till here?
>
>
> With my compiler, it gets destroyed immediately, so I made an
> implementation that simply instantiates the variable.
Which compiler is that? IHMO, there's only so much you should do to
handle non-conforming compilers; if a compiler fails to handle a thing
as simple as this it should be thrown out the window.
-- Daniel Wallin
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk