mirror of
https://github.com/boostorg/optional.git
synced 2025-07-18 06:42:06 +02:00
Tags in_place_init and in_place_init_if become inline constexpr
This commit is contained in:
@ -16,10 +16,10 @@
|
||||
namespace boost {
|
||||
|
||||
class in_place_init_t { /* see below */ } ; ``[link reference_in_place_init __GO_TO__]``
|
||||
const in_place_init_t in_place_init ( /* see below */ ) ;
|
||||
inline constexpr in_place_init_t in_place_init ( /* see below */ ) ;
|
||||
|
||||
class in_place_init_if_t { /*see below*/ } ; ``[link reference_in_place_init_if __GO_TO__]``
|
||||
const in_place_init_if_t in_place_init_if ( /*see below*/ ) ;
|
||||
inline constexpr in_place_init_if_t in_place_init_if ( /*see below*/ ) ;
|
||||
|
||||
template <class T>
|
||||
class optional ; ``[link reference_operator_template __GO_TO__]``
|
||||
|
@ -17,6 +17,7 @@
|
||||
* Dropped dependency on Boost.Utility.
|
||||
* Dropped dependency on Boost.Predef.
|
||||
* A bit faster implementation of some relational operations.
|
||||
* Tags `in_place_init` and `in_place_init_if` become `inline constexpr` and therewith leave smaller footprint in the executable. This addresses [@https://github.com/boostorg/optional/issues/103 issue #103].
|
||||
|
||||
|
||||
[heading Boost Release 1.85]
|
||||
|
@ -50,7 +50,7 @@ namespace {
|
||||
|
||||
#else
|
||||
|
||||
BOOST_INLINE_VARIABLE BOOST_CONSTEXPR_OR_CONST none_t none ((none_t::init_tag()));
|
||||
BOOST_INLINE_CONSTEXPR none_t none ((none_t::init_tag()));
|
||||
|
||||
#endif // older definitions
|
||||
|
||||
|
@ -103,17 +103,17 @@ namespace optional_ns {
|
||||
struct in_place_init_t
|
||||
{
|
||||
struct init_tag{};
|
||||
explicit in_place_init_t(init_tag){}
|
||||
BOOST_CONSTEXPR explicit in_place_init_t(init_tag){}
|
||||
};
|
||||
const in_place_init_t in_place_init ((in_place_init_t::init_tag()));
|
||||
BOOST_INLINE_CONSTEXPR in_place_init_t in_place_init ((in_place_init_t::init_tag()));
|
||||
|
||||
// a tag for conditional in-place initialization of contained value
|
||||
struct in_place_init_if_t
|
||||
{
|
||||
struct init_tag{};
|
||||
explicit in_place_init_if_t(init_tag){}
|
||||
BOOST_CONSTEXPR explicit in_place_init_if_t(init_tag){}
|
||||
};
|
||||
const in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));
|
||||
BOOST_INLINE_CONSTEXPR in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));
|
||||
|
||||
} // namespace optional_ns
|
||||
|
||||
|
Reference in New Issue
Block a user