mirror of
https://github.com/boostorg/optional.git
synced 2025-07-19 07:12:06 +02:00
spelling: recognized
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
committed by
Andrzej Krzemienski
parent
8ffb7e3f57
commit
db472e7ed6
@ -19,7 +19,7 @@ Lifetime of the `T` inside `_storage` is manually controlled with placement-`new
|
|||||||
T _storage;
|
T _storage;
|
||||||
};
|
};
|
||||||
|
|
||||||
We call it a ['direct] storage. This makes `optional<T>` a trivially-copyable type for scalar `T`s. This only works for compilers that support defaulted functions (including defaulted move assignment and constructor). On compilers without defaulted functions we still use the direct storage, but `optional<T>` is no longer recognized as trivially-copyable. Apart from scalar types, we leave the programmer a way of customizing her type, so that it is reconized by `optional` as candidate for optimized storage, by specializing type trait `boost::optional_config::optional_uses_direct_storage_for`:
|
We call it a ['direct] storage. This makes `optional<T>` a trivially-copyable type for scalar `T`s. This only works for compilers that support defaulted functions (including defaulted move assignment and constructor). On compilers without defaulted functions we still use the direct storage, but `optional<T>` is no longer recognized as trivially-copyable. Apart from scalar types, we leave the programmer a way of customizing her type, so that it is recognized by `optional` as candidate for optimized storage, by specializing type trait `boost::optional_config::optional_uses_direct_storage_for`:
|
||||||
|
|
||||||
struct X // not trivial
|
struct X // not trivial
|
||||||
{
|
{
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
defaulted move assignment and constructor). On compilers without defaulted
|
defaulted move assignment and constructor). On compilers without defaulted
|
||||||
functions we still use the direct storage, but <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
|
functions we still use the direct storage, but <code class="computeroutput"><span class="identifier">optional</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
|
||||||
is no longer recognized as trivially-copyable. Apart from scalar types, we
|
is no longer recognized as trivially-copyable. Apart from scalar types, we
|
||||||
leave the programmer a way of customizing her type, so that it is reconized
|
leave the programmer a way of customizing her type, so that it is recognized
|
||||||
by <code class="computeroutput"><span class="identifier">optional</span></code> as candidate
|
by <code class="computeroutput"><span class="identifier">optional</span></code> as candidate
|
||||||
for optimized storage, by specializing type trait <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">optional_config</span><span class="special">::</span><span class="identifier">optional_uses_direct_storage_for</span></code>:
|
for optimized storage, by specializing type trait <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">optional_config</span><span class="special">::</span><span class="identifier">optional_uses_direct_storage_for</span></code>:
|
||||||
</p>
|
</p>
|
||||||
|
Reference in New Issue
Block a user