Skip to main content
gamedev.net
🔒 Locked

boost::check_delete

Started by Gaiiden Dec 31, 2004 at 3:07 AM 2 replies 800+ views
Original Post
Gaiiden
Gaiiden
Anyone have exmaples of using check_delete? I couldn't find any in the Boost docs.
Drew Sikora
Executive Producer
GameDev.net
SiCrane
SiCrane
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 [].
Gaiiden
Gaiiden
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.
Drew Sikora
Executive Producer
GameDev.net
SiCrane
SiCrane
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).

Topic Locked

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

Sign in to reply to this topic.