Topic: auto_ptr: improved implementation - subtle issue with workaround


Author: rani_sharoni@hotmail.com ("Rani Sharoni")
Date: Thu, 18 Dec 2003 18:31:01 +0000 (UTC)
Raw View
Hi,

I discovered subtle issue in the new suggested implementation of auto_ptr
after John Potter noticed some odd requirement of 8.5.3/5/2/1/2.
8.5.3/5/2/1/2 mandates that in case that during the initialization of
reference from non const rvalue additional temporary is constructed then the
temporary is of *const* type.

This can be easily workaround by making the auto_ptr member *mutable*.

Although I'm certain that the "const temporary" requirement is defective for
class types (and AFAIKT this paragraph will be revised due to DR #391) and
it probably not relevant to any existing implementation I have no intention
to let any auto_ptr known subtlety to be overlooked.

Thanks,
Rani


---
[ 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                       ]