Topic: auto_ptr loophole revisited (Issue #84)


Author: fvali@eecs.ku.edu (faisal vali)
Date: Tue, 27 May 2003 17:24:24 +0000 (UTC)
Raw View
Issue 84 (it's resolution is included in TC1) deals with the loophole
that allows the auto_ptr constructors to distinguish between const
auto_ptrs and temporary auto_ptrs so that they are used only for copying
non-const auto_ptrs (in a sense).

According to this issue, auto_ptr's implementation (or rather behavior
is possible because it...) exploits a bug in the standard (described as
a "loophole on a loophole" in the issue), which i'm assuming is fixed by
the proposed resolution.

Could someone (*nudge EDG wizard-types*) please answer a few questions
for me:

1) does the resolution in fact close this loophole (if it does, can you
clarify how it manages that)

Does it do this by unambiguously stating that an Implicit Conversion
Sequence can only have one User Defined Conversion, and that the
sequence of conversions required for any initialization must be an
Implicit Conversion Sequence? (and so copy-initializing auto_ptr
parameters can't use two UDC's anymore?)

2) if the loophole is closed, how will auto_ptr continute to retain its
behavior (prior to the addition of move semantics to the language?)

For anyone interested, here is a link to the issue:

http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#84

thanks,
Faisal Vali

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]