Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This is an older version of Boost and was released in 2018. The current version is 1.89.0.
-Wzero-as-null-pointer-constant warnings.
optional
is now trivially-copyable for scalar Ts.
This uses a different storage (just T
rather than aligned_storage).
We require the compiler to support defaulted functions.
operator== to get rid of the -Wmaybe-uninitialized false-positive warning
from GCC.
emplace()
functions: they initialize the contained value by perfect-forwarding the
obtained arguments. One constructor always initializes the contained value,
the other based on a boolean condition.
o =
{} now correctly un-initializes
optional, just like in std::optional.
boost::optional is specialized for reference
parameters. This addresses a couple of issues:
sizeof of optional
reference is that of a pointer,
<type_traits>.
boost::none
again. Now it is a const object with internal linkage (as any other tag).
This fixes Trac
#11203.
emplace(),
and therewith removed the dependency on <boost/utility/in_place_factory.hpp>.
boost::none_t is no longer convertible from
literal 0. This avoids a bug
where optional<rational<int>> oi = 0; would
initialize an optional object with no contained value.
optional
without header optional_io.hpp
by using safe-bool idiom. This addresses Trac
#10825.
BOOST_OPTIONAL_CONFIG_NO_RVALUE_REFERENCES.
This can be used to work around Trac
#10399.
optional<U> to optional<T> when U
is not assignable or convertible to T
(Trac #11087).
optional<T&> (Trac
#10839).
<string>
to fix C++03 compile error on logic_error("...")".
optional<T> works with moveable but non-copyable
T's,
swap (now uses
move operations),
emplace(). This is the last of the requests from
Trac #1841,
optional is moveable, including
conditional noexcept specifications,
which make it move_if_noexcept-friendly,
operator<<(ostream&, optional
const&)
to prevent inadvertent incorrect serialization of optional objects,
reset() from examples (Trac
#9005),
boost::none
does not require that T
be EqualityComparable,
value(), value_or(), value_or_eval(),