site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Aug 9, 2005, at 7:51 PM, Andy Newman wrote: The initialization of ptr notionally invokes the copy constructor. Now std::auto_ptr's copy constructor takes a non-const reference arg and you're not allowed to have non-const references to temporary objects such as the one generated to convert the auto_ptr types. Hence the error. Isn't the whole purpose of the of the auto_ptr_ref struct to allow this? Is there some reason that it doesn't do this for the assignment line? - Steve _______________________________________________ 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... This email sent to site_archiver@lists.apple.com In the line std::auto_ptr<foo> ptr2(get_bar());, it uses operator auto_ptr_ref<_Tp>() and the auto_ptr(auto_ptr_ref ref) ctor (twice each, I think). It seems like the comment in the header is wrong if the code is an error. smime.p7s