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 ext_auto_ptr_07.zip (size
3KB)
> , which is available in files section of boost YahooGroup . If you
are
> not happy downloading file from Yahoo, you may get it from my own
WWW :
> http://b.kozicki.pl/cpp/ext_auto_ptr_07.zip .
>
> Actually ext_auto_ptr_07.zip contains two files: T191.hpp and
T191.cpp
> (both files are available standalone under
http://b.kozicki.pl/cpp/ ) .
> File T191.hpp contains improved auto_ptr (placed in namespace
> boost::ext), file T191.cpp is simple application using its new
features
> (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).
Whole
> story can be found here:
>
http://groups.google.com/groups?threadm=3fc75686%40news.microsoft.com
>
>

    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
    http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/1997/N1128.pdf.

    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:
    http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2000/n1232.pdf.
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
shared_ptr.

Best Regards,
Jonathan


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