diff --git a/doc/core.qbk b/doc/core.qbk index 3926983..d204081 100644 --- a/doc/core.qbk +++ b/doc/core.qbk @@ -63,7 +63,7 @@ Currently, the Core library contains: [`boost::swap`] ] [ - [null_deleter] + [[link core.null_deleter null_deleter]] [`boost::null_deleter`] ] [ @@ -84,3 +84,4 @@ Currently, the Core library contains: [include:core no_exceptions_support.qbk] [include:core noncopyable.qbk] [include:core swap.qbk] +[include:core null_deleter.qbk] diff --git a/doc/null_deleter.qbk b/doc/null_deleter.qbk new file mode 100644 index 0000000..747ac49 --- /dev/null +++ b/doc/null_deleter.qbk @@ -0,0 +1,22 @@ +[/ + / Copyright (c) 2014 Andrey Semashev + / + / Distributed under the Boost Software License, Version 1.0. (See accompanying + / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + /] + +[section:null_deleter Header ] + +The header `` defines the `boost::null_deleter` function object, +which can be used as a deleter with smart pointers such as `unique_ptr` or `shared_ptr`. The +deleter doesn't do anything with the pointer provided upon deallocation, which makes it useful +when the pointed object is deallocated elsewhere. + +Example + + std::shared_ptr< std::ostream > make_stream() + { + return std::shared_ptr< std::ostream >(&std::cout, boost::null_deleter()); + } + +[endsect]