Re: A Sample auto_ptr implementation
On Oct 17, 6:16 pm, Hendrik Schober <spamt...@gmx.de> wrote:
Barry wrote:
On Oct 15, 11:22 pm, Hendrik Schober <spamt...@gmx.de> wrote:
Barry wrote:
[...]
There's a reversion for auto_ptr (IIRC, a article is proviede by Maye=
r
on
this), adding auto_ptr_ref for conversion, which supports rvalue
initialization for auto_ptr. which is done transparently.
The guy's name is Scott Meyers and the article is here:
http://www.aristeia.com/BookErrata/auto_ptr-update.html
[...]
there are two problem with visual C++ 2005 in this issue:
1. as extension, "explicit" does NOT work as standard says.
needs /Za switch to turn it off.
Do you have a repro for this? I'd be very interested.
#include <memory>
int main()
{
std::auto_ptr<int> p1 = new int(10); // this shouldn't work
std::auto_ptr<int> p2(new int(10)); // should be like this!
}
[...]
Thanks.
It doesn't seem to be a compielr bug, though, as a simple
test with my own class makes the first line fail.
Maybe some Serive Package fix this.
I tried the code on Dinkumware
http://www.dinkumware.com/exam/default.aspx
it fails too.
--
Best Regards
Barry