From: helloworld922@gmail.com Date: Sat, 3 Aug 2013 09:00:28 +0000
I implemented std::unique_ptr using C++03 features plus a few other Boost Libraries. Incidentally, I also implemented default_delete (which binds to std::default_delete if available) because it's required for unique_ptr.
https://github.com/helloworld922/unique_ptr
The library binds to std::unique_ptr if standard library support is available. [SNIP] Current dependencies (assuming no C++11 std::unique_ptr):
- Boost.Config - Boost.Move - Boost.TypeTraits
Comments/Feedback is welcome.
Looking at "unique_ptr/boost/default_delete.hpp" as of SHA 6d294095747525ddb3a7481e374642156f5825ec: * If you're in an environment where the workaround for C++11 smart pointers are in play, then you probably don't have sibling-constructor (delegating) calls either. * When pointers are used for array new-ing, then cross-version conversions probably shouldn't be done, since U IS-A T doesn't mean that array-of-U IS-A array-of-T. (The spacing won't work right if the sizes of U and T differ. Neither will deletes unless a properly set custom deleter is used.) Daryle W.