1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>null_deleter</title> 5<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../index.html" title="Chapter 1. Boost.Core"> 8<link rel="up" href="../index.html" title="Chapter 1. Boost.Core"> 9<link rel="prev" href="noncopyable.html" title="noncopyable"> 10<link rel="next" href="nvp.html" title="nvp"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="noncopyable.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="nvp.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 27<a name="core.null_deleter"></a><a class="link" href="null_deleter.html" title="null_deleter">null_deleter</a> 28</h2></div></div></div> 29<div class="toc"><dl class="toc"><dt><span class="section"><a href="null_deleter.html#core.null_deleter.header_boost_core_null_deleter_h">Header 30 <boost/core/null_deleter.hpp></a></span></dt></dl></div> 31<div class="simplesect"> 32<div class="titlepage"><div><div><h3 class="title"> 33<a name="idm45312827201120"></a>Authors</h3></div></div></div> 34<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> 35 Andrey Semashev 36 </li></ul></div> 37</div> 38<div class="section"> 39<div class="titlepage"><div><div><h3 class="title"> 40<a name="core.null_deleter.header_boost_core_null_deleter_h"></a><a class="link" href="null_deleter.html#core.null_deleter.header_boost_core_null_deleter_h" title="Header <boost/core/null_deleter.hpp>">Header 41 <boost/core/null_deleter.hpp></a> 42</h3></div></div></div> 43<p> 44 The header <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">null_deleter</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> 45 defines the <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">null_deleter</span></code> function object, which can 46 be used as a deleter with smart pointers such as <code class="computeroutput"><span class="identifier">unique_ptr</span></code> 47 or <code class="computeroutput"><span class="identifier">shared_ptr</span></code>. The deleter 48 doesn't do anything with the pointer provided upon deallocation, which makes 49 it useful when the pointed object is deallocated elsewhere. 50 </p> 51<div class="section"> 52<div class="titlepage"><div><div><h4 class="title"> 53<a name="core.null_deleter.header_boost_core_null_deleter_h.example"></a><a class="link" href="null_deleter.html#core.null_deleter.header_boost_core_null_deleter_h.example" title="Example">Example</a> 54</h4></div></div></div> 55<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">></span> <span class="identifier">make_stream</span><span class="special">()</span> 56<span class="special">{</span> 57 <span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special"><</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ostream</span> <span class="special">>(&</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">null_deleter</span><span class="special">());</span> 58<span class="special">}</span> 59</pre> 60</div> 61</div> 62</div> 63<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 64<td align="left"></td> 65<td align="right"><div class="copyright-footer">Copyright © 2014 Peter Dimov<br>Copyright © 2014 Glen Fernandes<br>Copyright © 2014 Andrey Semashev<p> 66 Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost 67 Software License, Version 1.0</a>. 68 </p> 69</div></td> 70</tr></table> 71<hr> 72<div class="spirit-nav"> 73<a accesskey="p" href="noncopyable.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="nvp.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> 74</div> 75</body> 76</html> 77