Sign in to follow this  

boost::check_delete

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

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

This topic is 4735 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this