Or how about using the stl to provide the wrapper functor – Doug T. description but without the custom caller.
boost::shared_ptr<T> ptr( new T, std::mem_fun_ref(&T::deleteMe) );
boost::shared_ptr<S> ptr( new S, std::ptr_fun(lib_freeXYZ) );
More Related Contents:
- How to use Boost in Visual Studio 2010
- How do I combine hash values in C++0x?
- How to create a thread pool using boost in C++?
- Why override operator()?
- Cross-platform way to get line number of an INI file where given option was found
- Should we pass a shared_ptr by reference or by value?
- How to parse ini file with Boost
- how boost::function and boost::bind work
- C++ – passing references to std::shared_ptr or boost::shared_ptr
- Is there a way to test whether a C++ class has a default constructor (other than compiler-provided type traits)?
- How to release pointer from boost::shared_ptr?
- boost zip_iterator and std::sort
- Best way for interprocess communication in C++
- Spirit-Qi: How can I write a nonterminal parser?
- Can I redefine a C++ macro then define it back?
- C++ Boost: undefined reference to boost::system::generic_category()
- How to escape a string for use in Boost Regex
- Hash an arbitrary precision value (boost::multiprecision::cpp_int)
- Using boost::iostreams::mapped_file_source with std::multimap
- What’s the purpose of a leading “::” in a C++ method call
- Creating Library with backward compatible ABI that uses Boost
- How to parse csv using boost::spirit
- When must you pass io_context to boost::asio::spawn? (C++)
- Using boost parse datetime string: With single digit hour format
- Using condition variable in a producer-consumer situation
- What are the differences between std::variant and boost::variant?
- Boost.Python: Wrap functions to release the GIL
- Get private data members for non intrusive boost serialization C++
- asio How to change the executor inside an awaitable?
- how to do performance test using the boost library for a custom library