Skip to content
Branch: master
Find file Copy path
Find file Copy path
1 contributor

Users who have contributed to this file

89 lines (71 sloc) 2.66 KB

boost.out_ptr: the C+11 abstraction for passing smart pointers as parameters to `+T**` arguments

This library automates the .reset(…​) call with boost::out_ptr::out_ptr(…​) wrapping an argument passed to a C-style function taking a T** argument. Additionally, it automates the .release(…​) and .reset(…​) paradigm with boost::out_ptr::inout_ptr(…​) in cases where the T** argument passed to the function will both delete and then allocate the resource being handled.

Additional optimizations are implemented within the library to ensure good performance by default for a myriad of types, including boost::movelib:unique_ptr and std::unique_ptr. It also helps catch small errors in using shared_ptr-types reset calls, and works out-of-the-box for many other types including the upcoming std::retain_ptr, boost::intrusive_ptr, and any other types which follow the .reset(…​)/.release() paradigm (or have constructors that behave similarly).

Copyright, License, and Acknowledgments

This documentation is

  • Copyright ⓒ 2019 ThePhD

and is distributed under the Boost Software License, Version 1.0.

You can’t perform that action at this time.