1
0
forked from boostorg/core

Added docs for null_deleter.

This commit is contained in:
Andrey Semashev
2014-06-03 00:11:30 +04:00
parent 22d6f90385
commit fa82dd37a7
2 changed files with 24 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ Currently, the Core library contains:
[`boost::swap`] [`boost::swap`]
] ]
[ [
[null_deleter] [[link core.null_deleter null_deleter]]
[`boost::null_deleter`] [`boost::null_deleter`]
] ]
[ [
@@ -84,3 +84,4 @@ Currently, the Core library contains:
[include:core no_exceptions_support.qbk] [include:core no_exceptions_support.qbk]
[include:core noncopyable.qbk] [include:core noncopyable.qbk]
[include:core swap.qbk] [include:core swap.qbk]
[include:core null_deleter.qbk]

22
doc/null_deleter.qbk Normal file
View File

@@ -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 <boost/core/null_deleter.hpp>]
The header `<boost/core/null_deleter.hpp>` 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]