
--- Howard Hinnant <howard.hinnant@gmail.com> 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