Is there a stock no-op deallocator in Boost to use with boost::shared_ptr
for static objects, etc.
I know it\'s ultra-trivial to write, but I don\'t wan
Solution uses Boost.Lambda:
#include
#include
int main()
{
int *p = new int(5);
{
boost::shared_ptr sp(p, boost::lambda::_1);
}
delete p;
}
'boost::lambda::_1' creates an empty functor that takes one argument.
You'll probably want to put a //comment in there to let people know why you did it, though.