Jason Cipriani wrote:
The boost shared_ptr lets me specify my own destructor function, but shared_ptr does more than I want -- I do not need thread-safety or reference counting, and would like to avoid the associated overhead.
What I really want is an std::auto_ptr that lets me specify a destructor function. Does boost have something light-weight like this?
You're asking for the upcoming std::unique_ptr, but AFAIK boost currently does not provide it (I like to be corrected here). There exists a public domain implementation provided by Howard Hinnant, which comes quite next to its final interface (which has yet not been decided, but personally I'm quite sure that further changes are only marginal), http://home.twcny.rr.com/hinnant/cpp_extensions/unique_ptr.html (This link has been provided via issue http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#673 ) If you replace some used tr1 utilities (static_assert, tr1::is_reference, ...) by currently existing boost analoga, it should work for you, I guess, hmmmh, aeeh, if you have a compiler that understands the new rvalue references.... Greetings from Bremen, Daniel Krügler