• Advertisement
Sign in to follow this  

Question about an example of The Rule of Two.

This topic is 1692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

L. Spiro posted this in another thread: http://www.artima.com/cppsource/bigtwo3.html

I find the concept fascinating, but I have a some questions about two of the RAII class member functions.

1.) What does the reset function do? What I see happening is it deleting the member pointer and then assigning the pointer passed into the function to the deleted pointer. How does that work? Is that legal C++?

2.) What purpose is there for the swap function? Apart from sorting pointers, is there any other reason for its existence?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement