[DEV] add v1.76.0

This commit is contained in:
2021-10-05 21:37:46 +02:00
parent a97e9ae7d4
commit d0115b733d
45133 changed files with 4744437 additions and 1026325 deletions

View File

@@ -0,0 +1,78 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Acknowledgments</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="compatibility.html" title="Compatibility">
<link rel="next" href="history.html" title="History">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="compatibility.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="history.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.acknowledgments"></a><a class="link" href="acknowledgments.html" title="Acknowledgments">Acknowledgments</a>
</h2></div></div></div>
<p>
Thank you to everyone who reviewed the design, code, examples, tests, or documentation,
including:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Peter Dimov
</li>
<li class="listitem">
Andrey Semashev
</li>
<li class="listitem">
Bjorn Reese
</li>
<li class="listitem">
Steven Watanabe
</li>
<li class="listitem">
Antony Polukhin
</li>
<li class="listitem">
Lars Viklund
</li>
<li class="listitem">
Michael Spencer
</li>
<li class="listitem">
Paul A. Bristow
</li>
</ul></div>
<p>
Thank you to Ahmed Charles for serving as the review manager for the formal
review of the library.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="compatibility.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="history.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compatibility</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="vocabulary.html" title="Vocabulary">
<link rel="next" href="acknowledgments.html" title="Acknowledgments">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="vocabulary.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="acknowledgments.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.compatibility"></a><a class="link" href="compatibility.html" title="Compatibility">Compatibility</a>
</h2></div></div></div>
<p>
This library has been tested with the following C++ implementations:
</p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Compilers</span></dt>
<dd>
gcc, clang, msvc, intel
</dd>
<dt><span class="term">Libraries</span></dt>
<dd><p>
libstdc++, libc++, dinkumware
</p></dd>
<dt><span class="term">Systems</span></dt>
<dd><p>
linux, windows, osx
</p></dd>
<dt><span class="term">Platforms</span></dt>
<dd><p>
x64, x86, arm
</p></dd>
<dt><span class="term">Standards</span></dt>
<dd><p>
c++98, c++03, c++11, c++14, c++17
</p></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="vocabulary.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="acknowledgments.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,183 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Examples</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="rationale.html" title="Rationale">
<link rel="next" href="reference.html" title="Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rationale.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.examples"></a><a class="link" href="examples.html" title="Examples">Examples</a>
</h2></div></div></div>
<h4>
<a name="align.examples.h0"></a>
<span class="phrase"><a name="align.examples.aligned_allocation"></a></span><a class="link" href="examples.html#align.examples.aligned_allocation">Aligned
allocation</a>
</h4>
<p>
To dynamically allocate storage with desired alignment, you can use the <code class="computeroutput"><span class="identifier">aligned_alloc</span></code> function:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="keyword">void</span><span class="special">*</span>
<span class="identifier">storage</span> <span class="special">=</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_alloc</span><span class="special">(</span><span class="identifier">alignment</span><span class="special">,</span>
<span class="identifier">size</span><span class="special">);</span></code>
</li></ol></div>
<p>
To deallocate storage allocated with the <code class="computeroutput"><span class="identifier">aligned_alloc</span></code>
function, use the <code class="computeroutput"><span class="identifier">aligned_free</span></code>
function:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_free</span><span class="special">(</span><span class="identifier">storage</span><span class="special">);</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h1"></a>
<span class="phrase"><a name="align.examples.aligned_allocator"></a></span><a class="link" href="examples.html#align.examples.aligned_allocator">Aligned
allocator</a>
</h4>
<p>
For C++ allocator aware code, you can use the <code class="computeroutput"><span class="identifier">aligned_allocator</span></code>
class template for an allocator that respects over-alignment:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">int128_t</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_allocator</span><span class="special">&lt;</span><span class="identifier">int128_t</span><span class="special">&gt;</span>
<span class="special">&gt;</span> <span class="identifier">vector</span><span class="special">;</span></code>
</li></ol></div>
<p>
This template allows specifying minimum alignment for all dynamic allocations:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_allocator</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="number">64</span><span class="special">&gt;</span> <span class="special">&gt;</span>
<span class="identifier">vector</span><span class="special">;</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h2"></a>
<span class="phrase"><a name="align.examples.aligned_allocator_adaptor"></a></span><a class="link" href="examples.html#align.examples.aligned_allocator_adaptor">Aligned
allocator adaptor</a>
</h4>
<p>
To turn an allocator into an allocator that respects over-alignment, you can
use the <code class="computeroutput"><span class="identifier">aligned_allocator_adaptor</span></code>
class template:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_allocator_adaptor</span><span class="special">&lt;</span><span class="identifier">First</span><span class="special">&gt;</span> <span class="identifier">second</span><span class="special">(</span><span class="identifier">first</span><span class="special">);</span></code>
</li></ol></div>
<p>
This template allows specifying minimum alignment for all dynamic allocations:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_allocator_adaptor</span><span class="special">&lt;</span><span class="identifier">First</span><span class="special">,</span> <span class="number">64</span><span class="special">&gt;</span> <span class="identifier">second</span><span class="special">(</span><span class="identifier">first</span><span class="special">);</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h3"></a>
<span class="phrase"><a name="align.examples.aligned_deleter"></a></span><a class="link" href="examples.html#align.examples.aligned_deleter">Aligned
deleter</a>
</h4>
<p>
For a deleter that can be paired with <code class="computeroutput"><span class="identifier">aligned_alloc</span></code>,
you can use the <code class="computeroutput"><span class="identifier">aligned_delete</span></code>
class:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">unique_ptr</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">aligned_delete</span><span class="special">&gt;</span>
<span class="identifier">pointer</span><span class="special">;</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h4"></a>
<span class="phrase"><a name="align.examples.pointer_alignment"></a></span><a class="link" href="examples.html#align.examples.pointer_alignment">Pointer
alignment</a>
</h4>
<p>
To advance a pointer to the next address with the desired alignment:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<code class="computeroutput"><span class="keyword">void</span><span class="special">*</span>
<span class="identifier">pointer</span> <span class="special">=</span>
<span class="identifier">storage</span><span class="special">;</span></code>
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">space</span>
<span class="special">=</span> <span class="identifier">size</span><span class="special">;</span></code>
</li>
<li class="listitem">
<code class="computeroutput"><span class="keyword">void</span><span class="special">*</span>
<span class="identifier">result</span> <span class="special">=</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">align</span><span class="special">(</span><span class="number">64</span><span class="special">,</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="keyword">double</span><span class="special">),</span> <span class="identifier">pointer</span><span class="special">,</span> <span class="identifier">space</span><span class="special">);</span></code>
</li>
</ol></div>
<h4>
<a name="align.examples.h5"></a>
<span class="phrase"><a name="align.examples.querying_alignment"></a></span><a class="link" href="examples.html#align.examples.querying_alignment">Querying
alignment</a>
</h4>
<p>
To obtain the alignment of a given type at compie time, you can use:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">alignment_of</span><span class="special">&lt;</span><span class="identifier">int128_t</span><span class="special">&gt;::</span><span class="identifier">value</span></code>
</li></ol></div>
<p>
If your compiler supports C++14 variable templates, you can also use:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">alignment_of_v</span><span class="special">&lt;</span><span class="identifier">int128_t</span><span class="special">&gt;</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h6"></a>
<span class="phrase"><a name="align.examples.hinting_alignment"></a></span><a class="link" href="examples.html#align.examples.hinting_alignment">Hinting
alignment</a>
</h4>
<p>
To inform the compiler about the alignment of a pointer, you can use:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">BOOST_ALIGN_ASSUME_ALIGNED</span><span class="special">(</span><span class="identifier">pointer</span><span class="special">,</span> <span class="number">64</span><span class="special">)</span></code>
</li></ol></div>
<h4>
<a name="align.examples.h7"></a>
<span class="phrase"><a name="align.examples.checking_alignment"></a></span><a class="link" href="examples.html#align.examples.checking_alignment">Checking
alignment</a>
</h4>
<p>
To check alignment of a pointer you can use the <code class="computeroutput"><span class="identifier">is_aligned</span></code>
function:
</p>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<code class="computeroutput"><span class="identifier">assert</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">alignment</span><span class="special">::</span><span class="identifier">is_aligned</span><span class="special">(</span><span class="identifier">pointer</span><span class="special">,</span> <span class="number">64</span><span class="special">));</span></code>
</li></ol></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="rationale.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="reference.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,61 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>History</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="acknowledgments.html" title="Acknowledgments">
<link rel="next" href="../any.html" title="Chapter 4. Boost.Any">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="acknowledgments.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="../any.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.history"></a><a class="link" href="history.html" title="History">History</a>
</h2></div></div></div>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">Boost 1.61</span></dt>
<dd><p>
Functions for aligning up, down, and testing alignment of integral values.
</p></dd>
<dt><span class="term">Boost 1.59</span></dt>
<dd><p>
Joel Falcou and Charly Chevalier contributed the alignment hint macro.
</p></dd>
<dt><span class="term">Boost 1.56</span></dt>
<dd><p>
Glen Fernandes implemented and contributed the Align library to Boost.
</p></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="acknowledgments.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="../any.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Rationale</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="next" href="examples.html" title="Examples">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../align.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="examples.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.rationale"></a><a class="link" href="rationale.html" title="Rationale">Rationale</a>
</h2></div></div></div>
<h4>
<a name="align.rationale.h0"></a>
<span class="phrase"><a name="align.rationale.dynamic_allocation"></a></span><a class="link" href="rationale.html#align.rationale.dynamic_allocation">Dynamic
allocation</a>
</h4>
<p>
C++11 added the ability to specify increased alignment (over-alignment) for
class types. Unfortunately, <code class="computeroutput"><span class="special">::</span><span class="keyword">operator</span> <span class="keyword">new</span></code>
allocation functions, <code class="computeroutput"><span class="keyword">new</span></code> expressions
and the Default Allocator, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span></code>,
do not support dynamic memory allocation of over-aligned data. This library
provides allocation functions and allocators that respect the alignment requirements
of a type and so are suitable for allocating memory for over-aligned types.
</p>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term"><code class="computeroutput"><span class="identifier">aligned_alloc</span><span class="special">(</span><span class="identifier">alignment</span><span class="special">,</span> <span class="identifier">size</span><span class="special">)</span></code></span></dt>
<dd><p>
Replaces <code class="computeroutput"><span class="special">::</span><span class="keyword">operator</span>
<span class="keyword">new</span><span class="special">(</span><span class="identifier">size</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">nothrow</span><span class="special">)</span></code>
</p></dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">aligned_free</span><span class="special">(</span><span class="identifier">pointer</span><span class="special">)</span></code></span></dt>
<dd><p>
Replaces <code class="computeroutput"><span class="special">::</span><span class="keyword">operator</span>
<span class="keyword">delete</span><span class="special">(</span><span class="identifier">pointer</span><span class="special">,</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">nothrow</span><span class="special">)</span></code>
</p></dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">aligned_allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></span></dt>
<dd><p>
Replaces <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">allocator</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>
</p></dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">aligned_allocator_adaptor</span><span class="special">&lt;</span><span class="identifier">Allocator</span><span class="special">&gt;</span></code></span></dt>
<dd><p>
Replaces use of Allocator
</p></dd>
<dt><span class="term"><code class="computeroutput"><span class="identifier">aligned_delete</span></code></span></dt>
<dd><p>
Replaces <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">default_delete</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>
</p></dd>
</dl>
</div>
<h4>
<a name="align.rationale.h1"></a>
<span class="phrase"><a name="align.rationale.pointer_alignment"></a></span><a class="link" href="rationale.html#align.rationale.pointer_alignment">Pointer
alignment</a>
</h4>
<p>
C++11 provided <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">align</span></code> in the standard library to align a
pointer value. Unfortunately some C++ standard library implementations do not
support it yet (libstdc++ as far as gcc 4.8.0) and other standard library implementations
implement it incorrectly (dinkumware in msvc11.0). This library provides it
for those implementations and also for C++03 compilers where it is equally
useful.
</p>
<h4>
<a name="align.rationale.h2"></a>
<span class="phrase"><a name="align.rationale.querying_alignment"></a></span><a class="link" href="rationale.html#align.rationale.querying_alignment">Querying
alignment</a>
</h4>
<p>
C++11 provided the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">alignment_of</span></code> trait in the standard library
to query the alignment requirement of a type. Unfortunately some C++ standard
library vendors do not implement it in an entirely standard conforming manner,
such as for array types (libc++ as far as clang 3.4). Other vendor implementations
report incorrect values for certain types, such as pointer to members (msvc
14.0). This library provides it for those implementations and also for C++03
compilers where it is equally useful.
</p>
<h4>
<a name="align.rationale.h3"></a>
<span class="phrase"><a name="align.rationale.hinting_alignment"></a></span><a class="link" href="rationale.html#align.rationale.hinting_alignment">Hinting
alignment</a>
</h4>
<p>
Allocating aligned memory is sometimes not enough to ensure that optimal code
is generated. Developers use specific compiler intrinsics to notify the compiler
of a given alignment property of a memory block. This library provides a macro,
<code class="computeroutput"><span class="identifier">BOOST_ALIGN_ASSUME_ALIGNED</span></code>,
to abstract that functionality for compilers with the appropriate intrinsics.
</p>
<h4>
<a name="align.rationale.h4"></a>
<span class="phrase"><a name="align.rationale.checking_alignment"></a></span><a class="link" href="rationale.html#align.rationale.checking_alignment">Checking
alignment</a>
</h4>
<p>
This library provides a function, <code class="computeroutput"><span class="identifier">is_aligned</span></code>
to test the alignment of a pointer value. It is generally useful in assertions
to validate that memory is correctly aligned.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../align.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="examples.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,146 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Vocabulary</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../align.html" title="Chapter 3. Boost.Align">
<link rel="prev" href="reference.html" title="Reference">
<link rel="next" href="compatibility.html" title="Compatibility">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="compatibility.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="align.vocabulary"></a><a class="link" href="vocabulary.html" title="Vocabulary">Vocabulary</a>
</h2></div></div></div>
<h4>
<a name="align.vocabulary.h0"></a>
<span class="phrase"><a name="align.vocabulary.basic_align"></a></span><a class="link" href="vocabulary.html#align.vocabulary.basic_align">[basic.align]</a>
</h4>
<p>
Object types have <span class="emphasis"><em>alignment requirements</em></span> which place restrictions
on the addresses at which an object of that type may be allocated. An <span class="emphasis"><em>alignment</em></span>
is an implementation-defined integer value representing the number of bytes
between successive addresses at which a given object can be allocated. An object
type imposes an alignment requirement on every object of that type; stricter
alignment can be requested using the alignment specifier.
</p>
<p>
A <span class="emphasis"><em>fundamental alignment</em></span> is represented by an alignment
less than or equal to the greatest alignment supported by the implementation
in all contexts, which is equal to <code class="computeroutput"><span class="keyword">alignof</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">max_align_t</span><span class="special">)</span></code>.
The alignment required for a type might be different when it is used as the
type of a complete object and when it is used as the type of a subobject. [<span class="emphasis"><em>Example:</em></span>
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<code class="computeroutput"><span class="keyword">struct</span> <span class="identifier">B</span>
<span class="special">{</span> <span class="keyword">long</span>
<span class="keyword">double</span> <span class="identifier">d</span><span class="special">;</span> <span class="special">};</span></code>
</li>
<li class="listitem">
<code class="computeroutput"><span class="keyword">struct</span> <span class="identifier">D</span>
<span class="special">:</span> <span class="keyword">virtual</span>
<span class="identifier">B</span> <span class="special">{</span>
<span class="keyword">char</span> <span class="identifier">c</span><span class="special">;</span> <span class="special">};</span></code>
</li>
</ol></div>
<p>
When <code class="computeroutput"><span class="identifier">D</span></code> is the type of a complete
object, it will have a subobject of type <code class="computeroutput"><span class="identifier">B</span></code>,
so it must be aligned appropriately for a <code class="computeroutput"><span class="keyword">long</span>
<span class="keyword">double</span></code>. If <code class="computeroutput"><span class="identifier">D</span></code>
appears as a subobject of another object that also has <code class="computeroutput"><span class="identifier">B</span></code>
as a virtual base class, the <code class="computeroutput"><span class="identifier">B</span></code>
subobject might be part of a different subobject, reducing the alignment requirements
on the <code class="computeroutput"><span class="identifier">D</span></code> subobject. —<span class="emphasis"><em>end
example</em></span>] The result of the <code class="computeroutput"><span class="keyword">alignof</span></code>
operator reflects the alignment requirement of the type in the complete-object
case.
</p>
<p>
An <span class="emphasis"><em>extended alignment</em></span> is represented by an alignment greater
than <code class="computeroutput"><span class="keyword">alignof</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">max_align_t</span><span class="special">)</span></code>. It is implementation-defined whether any
extended alignments are supported and the contexts in which they are supported.
A type having an extended alignment requirement is an <span class="emphasis"><em>over-aligned
type</em></span>. [<span class="emphasis"><em>Note:</em></span> Every over-aligned type is or
contains a class type to which extended alignment applies (possibly through
a non-static data member). —<span class="emphasis"><em>end note</em></span>]
</p>
<p>
Alignments are represented as values of the type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span></code>.
Valid alignments include only those values returned by an <code class="computeroutput"><span class="keyword">alignof</span></code>
expression for the fundamental types plus an additional implementation-defined
set of values, which may be empty. Every alignment value shall be a non-negative
integral power of two.
</p>
<p>
Alignments have an order from <span class="emphasis"><em>weaker</em></span> to <span class="emphasis"><em>stronger</em></span>
or <span class="emphasis"><em>stricter</em></span> alignments. Stricter alignments have larger
alignment values. An address that satisfies an alignment requirement also satisfies
any weaker valid alignment requirement.
</p>
<p>
The alignment requirement of a complete type can be queried using an <code class="computeroutput"><span class="keyword">alignof</span></code> expression. Furthermore, the types
<code class="computeroutput"><span class="keyword">char</span></code>, <code class="computeroutput"><span class="keyword">signed</span>
<span class="keyword">char</span></code>, and <code class="computeroutput"><span class="keyword">unsigned</span>
<span class="keyword">char</span></code> shall have the weakest alignment
requirement. [<span class="emphasis"><em>Note:</em></span> This enables the character types to
be used as the underlying type for an aligned memory area. —<span class="emphasis"><em>end
note</em></span>]
</p>
<p>
Comparing alignments is meaningful and provides the obvious results:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Two alignments are equal when their numeric values are equal.
</li>
<li class="listitem">
Two alignments are different when their numeric values are not equal.
</li>
<li class="listitem">
When an alignment is larger than another it represents a stricter alignment.
</li>
</ul></div>
<p>
[<span class="emphasis"><em>Note:</em></span> The runtime pointer alignment function can be used
to obtain an aligned pointer within a buffer; the aligned-storage templates
in the library can be used to obtain aligned storage. —<span class="emphasis"><em>end
note</em></span>]
</p>
<p>
If a request for a specific extended alignment in a specific context is not
supported by an implementation, the program is ill-formed. Additionally, a
request for runtime allocation of dynamic storage for which the requested alignment
cannot be honored shall be treated as an allocation failure.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2014-2017 Glen
Joseph Fernandes<p>
Distributed under the Boost Software License, Version 1.0.
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="reference.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../align.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="compatibility.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>