Boost logo

Boost :

From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2006-03-14 12:42:10


--- Howard Hinnant <howard.hinnant_at_[hidden]> wrote:

> This is one of the areas where the emulated version is a little
> different from the real deal. You can work around this in one of two
> ways:
>
> unique_ptr<int[]>
> foo(unsigned size)
> {
> unique_ptr<int[]> result(new int[size]);
> // do something to result
> // if an exception is thrown result will be cleaned up
> return move(result);
> }

The additional move() does the trick for gcc 3.4 and EDG 245. Thanks!

Unfortunately EDG 238 chokes (enable_if_does_not_work_on_this_compiler<T>) and
gcc 2.96 gives an ICE. I'd be ready to finally give up on gcc 2.96, but EDG 238
is still important (sigh). I'll have to stick to my quick-and-dirty,
old-fashioned auto_array emulation for the time being.

Cheers,
        Ralf

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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