Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

Meyer's auto_ptr

Started by crazyjul Aug 29, 2003 at 2:13 AM 1 replies 900+ views
Original Post
crazyjul
crazyjul
Does anybody read More Effective C++ from S. Meyers? I''ve implemented the auto_ptr template, but I''ve got a problem In the class definition, Meyer declare this
template<class U> friend class auto_ptr<U>;
I try different compiler ( VS6, VS7, gcc), and all complain, different thing, but complain. Does anybody knows? Crazyjul
antareus
antareus
Refresh my memory why he wrote one when there is already one built in? Check the memory header.
--God has paid us the intolerable compliment of loving us, in the deepest, most tragic, most inexorable sense.- C.S. Lewis
crazyjul
crazyjul
because the standard auto_ptr need , for example, copy constructor and assignment operator. So, i don''t want some object to have this. Make (for me) auto_ptr unsuitable

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.