Jump to content
  • Advertisement
Sign in to follow this  
Gaiiden

boost::check_delete

This topic is 5041 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

Advertisement
You'd use boost::checked_delete pretty much like you'd use delete; internally all it does is call delete anyways. It just causes a compile error if you try to delete a pointer to an incomplete type.

edit: and you use boost::checked_array_delete like you'd use delete [].

Share this post


Link to post
Share on other sites
Oh. Now I realize I was looking at it wrong. I got it from this thread here and I thought it did the same thing the code snippet did, so looking at it that way I couldn't make head or tails of it [smile] makes sense now.

Share this post


Link to post
Share on other sites
Well, if you want, boost::checked_deleter<> (extra r is significant) is equivalent to the function object in the first post (except again it doesn't allow the deletion of a pointer to an incomplete type).

Share this post


Link to post
Share on other sites
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!