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