|
Boost : |
From: Ralf W. Grosse-Kunstleve (rwgk_at_[hidden])
Date: 2006-03-14 02:04:20
--- Howard Hinnant <howard.hinnant_at_[hidden]> wrote:
> According to this proposal your code would be:
>
> std::unique_ptr<int[]>
> foo(unsigned size)
> {
> std::unique_ptr<int[]> result(new int[size]);
> // do something to result
> // if an exception is thrown result will be cleaned up
> return result;
> }
Hi Howard, I fetched your emulation code and tried to compile the function
above; the only change I made was to put your entire file into my own namespace
(instead of std::). Both EDG 245 and gcc 3.4 give similar errors:
cxx: Error: /net/legless/scratch1/rwgk/dist/iotbx/include/iotbx/pdb/input.h,
line 1035: #330-D
"scitbx::unique_ptr<T [], D>::unique_ptr(scitbx::unique_ptr<T [], D>
&) [with T=int, D=scitbx::default_delete<int []>]" is inaccessible
return result;
-----------^
Is this an oversight, or do I have to use unique_ptr<> somehow differently?
Thanks!
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