代码拉取完成,页面将自动刷新
<!-- HTML header for doxygen 1.8.16-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>memory: reference_storage< RawAllocator > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">memory
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="main-nav">
<ul class="sm sm-dox" id="main-menu">
<li><a href="index.html">Main Page</a></li>
<li><a href="md_doc_tutorial.html">Tutorial</a></li>
<li><a href="namespacefoonathan_1_1memory.html">Index</a></li>
<li><a href="files.html">Files</a></li>
</ul>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacefoonathan.html">foonathan</a></li><li class="navelem"><a class="el" href="namespacefoonathan_1_1memory.html">memory</a></li><li class="navelem"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Typedefs</a> |
<a href="#pub-methods">Member Functions</a> </div>
<div class="headertitle">
<div class="title">reference_storage< RawAllocator > Class Template Reference<div class="ingroups"><a class="el" href="group__storage.html">Allocator storage</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template<class RawAllocator><br />
class foonathan::memory::reference_storage< RawAllocator ></h3>
<p>A <a href="md_doc_concepts.html#concept_storagepolicy">StoragePolicy</a> that stores a reference to an allocator. </p>
<p>For stateful allocators it only stores a pointer to an allocator object and copying/moving only copies the pointer. For stateless allocators it does not store anything, an allocator will be constructed as needed. For allocators that are already shared (determined through <a class="el" href="structfoonathan_1_1memory_1_1is__shared__allocator.html">is_shared_allocator</a>) it will store the allocator type directly. </p><dl class="section note"><dt>Note</dt><dd>It does not take ownership over the allocator in the stateful case, the user has to ensure that the allocator object stays valid. In the other cases the lifetime does not matter. </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a822c89378d2400636a878d6e43ea066e"><td class="memItemLeft" align="right" valign="top"><a id="a822c89378d2400636a878d6e43ea066e"></a>
using </td><td class="memItemRight" valign="bottom"><b>allocator_type</b> = typename <a class="el" href="classfoonathan_1_1memory_1_1allocator__traits.html">allocator_traits</a>< RawAllocator >::allocator_type</td></tr>
<tr class="separator:a822c89378d2400636a878d6e43ea066e"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Member Functions</h2></td></tr>
<tr class="memitem:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#aa4d78cedf879eacbb2956c3e54e62c8d">reference_storage</a> () noexcept=default</td></tr>
<tr class="memdesc:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="classfoonathan_1_1memory_1_1reference__storage.html#aa4d78cedf879eacbb2956c3e54e62c8d">More...</a><br /></td></tr>
<tr class="separator:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:abc9082c55180c91a3f9b762ce7b6a9c6"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#abc9082c55180c91a3f9b762ce7b6a9c6">reference_storage</a> (const allocator_type &alloc) noexcept</td></tr>
<tr class="separator:abc9082c55180c91a3f9b762ce7b6a9c6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:addc2fea0bd7cde7b4781f47b217defaf"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#addc2fea0bd7cde7b4781f47b217defaf">reference_storage</a> (allocator_type &alloc) noexcept</td></tr>
<tr class="separator:addc2fea0bd7cde7b4781f47b217defaf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a420e60e9788bfa3b52aa3aab72ea3a5e"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a420e60e9788bfa3b52aa3aab72ea3a5e">operator bool</a> () const noexcept</td></tr>
<tr class="separator:a420e60e9788bfa3b52aa3aab72ea3a5e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a63c2ce62648bfde50384f249c4d77cf5"><td class="memItemLeft" align="right" valign="top">allocator_type & </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a63c2ce62648bfde50384f249c4d77cf5">get_allocator</a> () const noexcept</td></tr>
<tr class="separator:a63c2ce62648bfde50384f249c4d77cf5"><td class="memSeparator" colspan="2"> </td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:aaff3b70fb06a4132e91c5f7e3e3931c0"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#aaff3b70fb06a4132e91c5f7e3e3931c0">reference_storage</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &) noexcept=default</td></tr>
<tr class="separator:aaff3b70fb06a4132e91c5f7e3e3931c0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8057733ed13a54a708f9e9806d8b401d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a8057733ed13a54a708f9e9806d8b401d">operator=</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &) noexcept=default</td></tr>
<tr class="separator:a8057733ed13a54a708f9e9806d8b401d"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructors</h2>
<a id="aa4d78cedf879eacbb2956c3e54e62c8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4d78cedf879eacbb2956c3e54e62c8d">◆ </a></span>reference_storage() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<dl class="section user"><dt>Effects:</dt><dd>If the allocator is stateless, this has no effect and the object is usable as an allocator. If the allocator is stateful, creates an invalid reference without any associated allocator. Then it must not be used. If the allocator is shared, default constructs the shared allocator. If the shared allocator does not have a default constructor, this constructor is ill-formed. </dd></dl>
</div>
</div>
<a id="abc9082c55180c91a3f9b762ce7b6a9c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc9082c55180c91a3f9b762ce7b6a9c6">◆ </a></span>reference_storage() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">const allocator_type & </td>
<td class="paramname"><em>alloc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Creates it from a stateless or shared allocator. It will not store anything, only creates the allocator as needed. </dd></dl>
<dl class="section user"><dt>Requires:</dt><dd>The <code>RawAllocator</code> is stateless or shared. </dd></dl>
</div>
</div>
<a id="addc2fea0bd7cde7b4781f47b217defaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addc2fea0bd7cde7b4781f47b217defaf">◆ </a></span>reference_storage() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">allocator_type & </td>
<td class="paramname"><em>alloc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Creates it from a reference to a stateful allocator. It will store a pointer to this allocator object. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The user has to take care that the lifetime of the reference does not exceed the allocator lifetime. </dd></dl>
</div>
</div>
<a id="aaff3b70fb06a4132e91c5f7e3e3931c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaff3b70fb06a4132e91c5f7e3e3931c0">◆ </a></span>reference_storage() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>< RawAllocator > & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Copies the <code>allocator_reference</code> object. Only copies the pointer to it in the stateful case. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Functions</h2>
<a id="a8057733ed13a54a708f9e9806d8b401d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8057733ed13a54a708f9e9806d8b401d">◆ </a></span>operator=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>& operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>< RawAllocator > & </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Copies the <code>allocator_reference</code> object. Only copies the pointer to it in the stateful case. </dd></dl>
</div>
</div>
<a id="a420e60e9788bfa3b52aa3aab72ea3a5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a420e60e9788bfa3b52aa3aab72ea3a5e">◆ </a></span>operator bool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">operator bool </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>Whether or not the reference is valid. It is only invalid, if it was created by the default constructor and the allocator is stateful. </dd></dl>
</div>
</div>
<a id="a63c2ce62648bfde50384f249c4d77cf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63c2ce62648bfde50384f249c4d77cf5">◆ </a></span>get_allocator()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">allocator_type& get_allocator </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>Returns a reference to the allocator. </dd></dl>
<dl class="section user"><dt>Requires:</dt><dd>The reference must be valid. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.16-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。