Jump to content
  • Advertisement
Sign in to follow this  
MarkS

Question about an example of The Rule of Two.

This topic is 1818 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!