1 Star 0 Fork 0

mobangjack / memory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html 14.81 KB
一键复制 编辑 原始数据 按行查看 历史
Jonathan Müller 提交于 2020-05-05 17:04 . Update documentation
<!-- 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&lt; any_allocator &gt; Class 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_3_01any__allocator_01_4.html">reference_storage&lt; any_allocator &gt;</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Typedefs</a> &#124;
<a href="#pub-methods">Member Functions</a> </div>
<div class="headertitle">
<div class="title">reference_storage&lt; any_allocator &gt; Class 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"><p>Specialization of the class template <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> that is type-erased. </p>
<p>It is triggered by the tag type <a class="el" href="structfoonathan_1_1memory_1_1any__allocator.html">any_allocator</a>. The specialization can store a reference to any allocator type. </p>
</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:a1b02c55c2207b3720fa78eb2d2350edf"><td class="memItemLeft" align="right" valign="top"><a id="a1b02c55c2207b3720fa78eb2d2350edf"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>allocator_type</b> = FOONATHAN_IMPL_DEFINED(base_allocator)</td></tr>
<tr class="separator:a1b02c55c2207b3720fa78eb2d2350edf"><td class="memSeparator" colspan="2">&#160;</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:a1d561ab24b6e294958d2992c14e666ec"><td class="memTemplParams" colspan="2">template&lt;class RawAllocator &gt; </td></tr>
<tr class="memitem:a1d561ab24b6e294958d2992c14e666ec"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a1d561ab24b6e294958d2992c14e666ec">reference_storage</a> (RawAllocator &amp;alloc) noexcept</td></tr>
<tr class="separator:a1d561ab24b6e294958d2992c14e666ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e33a94b87ac6023669e7d03786724fc"><td class="memTemplParams" colspan="2">template&lt;class RawAllocator &gt; </td></tr>
<tr class="memitem:a6e33a94b87ac6023669e7d03786724fc"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a6e33a94b87ac6023669e7d03786724fc">reference_storage</a> (const RawAllocator &amp;alloc, FOONATHAN_REQUIRES(!<a class="el" href="classfoonathan_1_1memory_1_1allocator__traits.html">allocator_traits</a>&lt; RawAllocator &gt;::is_stateful::value)) noexcept</td></tr>
<tr class="memdesc:a6e33a94b87ac6023669e7d03786724fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">It will not store anything, only creates the allocator as needed. <a href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a6e33a94b87ac6023669e7d03786724fc">More...</a><br /></td></tr>
<tr class="separator:a6e33a94b87ac6023669e7d03786724fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6eae83e1231e844b2b55e059f61ef72"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#ad6eae83e1231e844b2b55e059f61ef72">reference_storage</a> (const FOONATHAN_IMPL_DEFINED(base_allocator) &amp;alloc) noexcept</td></tr>
<tr class="separator:ad6eae83e1231e844b2b55e059f61ef72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63c2ce62648bfde50384f249c4d77cf5"><td class="memItemLeft" align="right" valign="top">allocator_type &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a63c2ce62648bfde50384f249c4d77cf5">get_allocator</a> () const noexcept</td></tr>
<tr class="separator:a63c2ce62648bfde50384f249c4d77cf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a388fc1920d2c0a7d133405b219193c4e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a388fc1920d2c0a7d133405b219193c4e">reference_storage</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;other) noexcept</td></tr>
<tr class="separator:a388fc1920d2c0a7d133405b219193c4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5bad95454a5dd87bca93cff1777cc167"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage_3_01any__allocator_01_4.html#a5bad95454a5dd87bca93cff1777cc167">operator=</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;other) noexcept</td></tr>
<tr class="separator:a5bad95454a5dd87bca93cff1777cc167"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructors</h2>
<a id="a1d561ab24b6e294958d2992c14e666ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d561ab24b6e294958d2992c14e666ec">&#9670;&nbsp;</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="paramtype">RawAllocator &amp;&#160;</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 any stateful <a href="md_doc_concepts.html#concept_rawallocator">RawAllocator</a>. 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="a6e33a94b87ac6023669e7d03786724fc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e33a94b87ac6023669e7d03786724fc">&#9670;&nbsp;</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 RawAllocator &amp;&#160;</td>
<td class="paramname"><em>alloc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FOONATHAN_REQUIRES(!<a class="el" href="classfoonathan_1_1memory_1_1allocator__traits.html">allocator_traits</a>&lt; RawAllocator &gt;::is_stateful::value)&#160;</td>
<td class="paramname">&#160;</td>
</tr>
<tr>
<td></td>
<td>)</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">
<p>It will not store anything, only creates the allocator as needed. </p>
<dl class="section user"><dt>Requires:</dt><dd>The <code>RawAllocator</code> is stateless. </dd></dl>
</div>
</div>
<a id="ad6eae83e1231e844b2b55e059f61ef72"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6eae83e1231e844b2b55e059f61ef72">&#9670;&nbsp;</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">const FOONATHAN_IMPL_DEFINED(base_allocator) &amp;&#160;</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 the internal base class for the type-erasure. Has the same effect as if the actual stored allocator were passed to the other constructor overloads. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This constructor is used internally to avoid double-nesting. </dd></dl>
</div>
</div>
<a id="a388fc1920d2c0a7d133405b219193c4e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a388fc1920d2c0a7d133405b219193c4e">&#9670;&nbsp;</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>&lt; <a class="el" href="structfoonathan_1_1memory_1_1any__allocator.html">any_allocator</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>other</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>Copies the <code>reference_storage</code> object. It only copies the pointer to the allocator. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Functions</h2>
<a id="a5bad95454a5dd87bca93cff1777cc167"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5bad95454a5dd87bca93cff1777cc167">&#9670;&nbsp;</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>&amp; operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>&lt; <a class="el" href="structfoonathan_1_1memory_1_1any__allocator.html">any_allocator</a> &gt; &amp;&#160;</td>
<td class="paramname"><em>other</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>Copies the <code>reference_storage</code> object. It only copies the pointer to the allocator. </dd></dl>
</div>
</div>
<a id="a63c2ce62648bfde50384f249c4d77cf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63c2ce62648bfde50384f249c4d77cf5">&#9670;&nbsp;</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&amp; 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>A reference to the allocator. The actual type is implementation-defined since it is the base class used in the type-erasure, but it provides the full <a href="md_doc_concepts.html#concept_rawallocator">RawAllocator</a> member functions. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>There is no way to access any custom member functions of the allocator type. </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 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
1
https://gitee.com/mobangjack/memory.git
git@gitee.com:mobangjack/memory.git
mobangjack
memory
memory
gh-pages

搜索帮助