Re: auto_ptr not behaving as per header comment
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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; } void use_foo(std::auto_ptr<foo>); std::auto_ptr<bar> aBar; use_foo(aBar); - WBR, Alexey Proskuryakov _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... On Tue, 9 Aug 2005 18:56:24 -0700 Steve Checkoway <steve@cs.washington.edu> wrote: 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...): 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Alexey Proskuryakov