Re: auto_ptr not behaving as per header comment
Re: auto_ptr not behaving as per header comment
- Subject: Re: auto_ptr not behaving as per header comment
- From: "Alexey Proskuryakov" <email@hidden>
- Date: Wed, 10 Aug 2005 09:13:57 +0400
On Tue, 9 Aug 2005 18:56:24 -0700 Steve Checkoway <email@hidden>
wrote:
struct foo { };
struct bar : public foo { };
std::auto_ptr<bar> get_bar() { return std::auto_ptr<bar>(new bar); }
int main()
{
std::auto_ptr<foo> ptr = get_bar();
return 0;
}
This code looks intuitively correct, so it *should* be OK, in general
sense. A closely related issue in the C++ standard is described here:
<http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#463> (may even be
exactly the same, I'm not sure). When corrections to the standard introduce
such severe regressions, I don't know who is to blame.
CodeWarrior compiles this just fine (why am I not surprised?), but still
doesn't compile other intuitively correct code (grrrr...):
void use_foo(std::auto_ptr<foo>);
std::auto_ptr<bar> aBar;
use_foo(aBar);
I'd expect this issue to have been extensively discussed, filed in the gcc
bugzilla etc - I just haven't researched it a lot. Of Apple mail lists,
xcode-users appears the most relevant.
- WBR, Alexey Proskuryakov
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden