Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-01-18 03:11:10

"Bronek Kozicki" <brok_at_[hidden]> wrote in message:
> Dear Boosters
> I want to ask you to take a look at file (size
> , which is available in files section of boost YahooGroup . If you
> not happy downloading file from Yahoo, you may get it from my own
> .
> Actually contains two files: T191.hpp and
> (both files are available standalone under ) .
> File T191.hpp contains improved auto_ptr (placed in namespace
> boost::ext), file T191.cpp is simple application using its new
> (tested under MSVC71 and MINGW - GCC 3.3.1).
> This auto_ptr is based on Rani Sharoni proposal to improve standard
> std::auto_ptr. Rani's idea is to use SFINAE in smart way and remove
> auto_ptr_ref from standard (as there is no longer need for it).
> story can be found here:

    The implementation of auto_ptr seems impressive! I have not
studied it in detail, but it looks like it correctly handles the four
cases in

    With something as subtle as auto_ptr, you defintely need to
provide a test program to prove that it satisfies the various auto_ptr
desiderata. The only one I know of is here:
This test fails to compile (on VC7.1) with your auto_ptr; this doesn't
say much, however, since it compiles with the Dinkumware auto_ptr but
crashes when run. (I haven't looked closely enough to see why this
happens.) At any rate, you need to provide tests.

   I think you also need more motivation for the introduction of
deleters. You should show how they would be used in realistic
situations and why they would be more convenient or safer than other
well-known alternatives (e.g. shared_ptr, vector, an auto_array
template or a special pupose class which does cleanup in its
destructor). Saying you want to make auto_ptr more compatible with
shared_ptr does not seem sufficient, since the deleters don't have the
same form as those used with shared_ptr, and you can't use your
auto_ptrs with incomplete types, which is one of the key features of

Best Regards,

Boost list run by bdawes at, gregod at, cpdaniel at, john at