From 323f28aa9be80ca30570e1b98282053915cf0937 Mon Sep 17 00:00:00 2001 From: Brian Bi Date: Fri, 30 Aug 2024 11:19:33 -0400 Subject: [PATCH] add t_ to bslstl_optional.h templates (#4643) --- groups/bsl/bslstl/bslstl_optional.h | 1216 +++-- groups/bsl/bslstl/bslstl_optional_cpp03.h | 5457 ++++++++++----------- 2 files changed, 3273 insertions(+), 3400 deletions(-) diff --git a/groups/bsl/bslstl/bslstl_optional.h b/groups/bsl/bslstl/bslstl_optional.h index 4562a0541d..ff0788eae7 100644 --- a/groups/bsl/bslstl/bslstl_optional.h +++ b/groups/bsl/bslstl/bslstl_optional.h @@ -387,7 +387,7 @@ BSLS_IDENT("$Id: $") !bsl::is_same< \ typename bsl::remove_cvref::type, \ bsl::allocator_arg_t>::value, \ - optional >::type + optional >::type #ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULT_TEMPLATE_ARGS #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) = ARG @@ -395,6 +395,12 @@ BSLS_IDENT("$Id: $") #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) #endif +#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS + #define BSLSTL_OPTIONAL_REQUIRES(EXPR) requires(EXPR) +#else + #define BSLSTL_OPTIONAL_REQUIRES(EXPR) +#endif + namespace BloombergLP { namespace bslstl { struct Optional_NulloptConstructToken { @@ -465,26 +471,26 @@ namespace bslstl { # ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY -template +template struct Optional_IsTriviallyDestructible -: std::is_trivially_destructible { - // This metafunction is derived from 'std::is_trivially_destructible' - // in C++11 and later. In C++03, the metafunction is derived from - // 'bsl::is_trivially_copyable', a trait that implies the type is also - // trivially destructible. +: std::is_trivially_destructible { + // This metafunction is derived from + // 'std::is_trivially_destructible' in C++11 and later. In C++03, + // the metafunction is derived from 'bsl::is_trivially_copyable', a trait + // that implies the type is also trivially destructible. }; # else // BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY -template -struct Optional_IsTriviallyDestructible : bslmf::IsBitwiseCopyable { +template +struct Optional_IsTriviallyDestructible : bslmf::IsBitwiseCopyable { // C++03 does not provide a trivially destructible trait. Instead we use // 'bslmf::IsBitwiseCopyable' which implies the type is also trivially // destructible. // // Note that we use 'bslmf::IsBitwiseCopyable' here and not // 'bsl::is_trivially_copyable' because on some platforms, the native - // 'std::is_trivially_copyable>' is 'false' + // 'std::is_trivially_copyable>' is 'false' // even though it has no d'tor and 'TYPE' is trivally copyable. }; @@ -521,14 +527,16 @@ BSLS_KEYWORD_CONSTEXPR Optional_OptNoSuchType::Optional_OptNoSuchType( // class Optional_PropagatesAllocator // ================================== -template +template struct Optional_PropagatesAllocator : bsl::integral_constant< bool, - bslma::UsesBslmaAllocator::value && bsl::is_const::value && - bsl::is_same::type>::value> { - // This metafunction is derived from 'bsl::true_type' if 'TYPE' is an - // allocator-aware const type, and if 'ANY_TYPE' is the same as 'TYPE', + bslma::UsesBslmaAllocator::value && + bsl::is_const::value && + bsl::is_same::type>::value> { + // This metafunction is derived from 'bsl::true_type' if 't_TYPE' is an + // allocator-aware const type, and if 't_ANY_TYPE' is the same as 't_TYPE', // minus the cv qualification. This trait is used to enable a constructor // overload for a const qualified allocator-aware 'ValueType' taking an // rvalue of Optional_Base of the non-const qualified 'ValueType'. Such an @@ -572,7 +580,7 @@ struct Optional_MoveConstructFromStdOptional {}; // class Optional_DataImp // ====================== -template +template struct Optional_DataImp { // This component-private 'struct' manages a 'value_type' object in an // 'Optional_Base' object. This class provides an abstraction for 'const' @@ -586,7 +594,7 @@ struct Optional_DataImp { private: // PRIVATE TYPES - typedef typename bsl::remove_const::type StoredType; + typedef typename bsl::remove_const::type StoredType; // DATA bsls::ObjectBuffer d_buffer; @@ -602,23 +610,22 @@ struct Optional_DataImp { // MANIPULATORS #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); // Create an object of 'StoredType' in 'd_buffer' using the specified - // 'allocator' and arguments and return a reference providing - // modifiable access to the underlying 'TYPE' object. + // 'allocator' and 'args' and return a reference providing modifiable + // access to the underlying 't_TYPE' object. # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); // Create an object of 'StoredType' in 'd_buffer' using the specified - // 'allocator', 'initializer_list' and arguments, and return a - // reference providing modifiable access to the underlying 'TYPE' - // object. - + // 'allocator', 'initializer_list', and 'args', and return a reference + // providing modifiable access to the underlying 't_TYPE' object. # endif // BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS #endif @@ -626,15 +633,15 @@ struct Optional_DataImp { // Destroy the 'value_type' object in 'd_buffer', if any. # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS - TYPE& value() &; - TYPE&& value() &&; + t_TYPE& value() &; + t_TYPE&& value() &&; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # else - TYPE& value(); + t_TYPE& value(); // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else @@ -643,16 +650,16 @@ struct Optional_DataImp { // Return 'true' if this objects has a value, and 'false' otherwise. # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS - const TYPE& value() const &; - const TYPE&& value() const &&; + const t_TYPE& value() const &; + const t_TYPE&& value() const &&; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # else - const TYPE& value() const; + const t_TYPE& value() const; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else }; @@ -662,14 +669,14 @@ struct Optional_DataImp { // =================== template < - class TYPE, - bool IS_TRIVIALLY_DESTRUCTIBLE = - bslstl::Optional_IsTriviallyDestructible::value> -struct Optional_Data : public Optional_DataImp { + class t_TYPE, + bool t_IS_TRIVIALLY_DESTRUCTIBLE = + bslstl::Optional_IsTriviallyDestructible::value> +struct Optional_Data : public Optional_DataImp { // This component-private 'struct' manages a 'value_type' object in // 'Optional_Base' by inheriting from `Optional_DataImp`. In addition, - // this primary template properly destroys the owned instance of 'TYPE' in - // its destructor. + // this primary template properly destroys the owned instance of 't_TYPE' + // in its destructor. public: // CREATORS @@ -681,8 +688,8 @@ struct Optional_Data : public Optional_DataImp { // class Optional_Data // =================== -template -struct Optional_Data : public Optional_DataImp { +template +struct Optional_Data : public Optional_DataImp { // This partial specialization manages a trivially destructible // 'value_type' in Optional_Base. It does not have a user-provided // destructor, which makes it 'is_trivially_destructible' itself. @@ -690,7 +697,7 @@ struct Optional_Data : public Optional_DataImp { public: BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Data, bslmf::IsBitwiseCopyable, - bslmf::IsBitwiseCopyable::value); + bslmf::IsBitwiseCopyable::value); }; // ========================== @@ -2316,41 +2323,40 @@ namespace bsl { # ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD // CLASS TEMPLATE DEDUCTION GUIDES -template -optional(TYPE) -> optional; - // Deduce the specified type 'TYPE' from the corresponding type supplied to - // the constructor of 'optional'. +template +optional(t_TYPE) -> optional; + // Deduce the specified type 't_TYPE' from the corresponding type supplied + // to the constructor of 'optional'. -template ::value>, + BloombergLP::bslma::UsesBslmaAllocator::value>, class = typename bsl::enable_if_t< - bsl::is_convertible_v>> + bsl::is_convertible_v>> > -optional(bsl::allocator_arg_t, ALLOC, TYPE) --> optional; - // Deduce the specified type 'TYPE' from the corresponding type supplied to - // the constructor of 'optional'. This guide does not participate in - // deduction unless the deduced type 'TYPE' supports the bslma allocator - // model, and specified 'ALLOC' can be implicitly converted to +optional(bsl::allocator_arg_t, t_ALLOC, t_TYPE) +-> optional; + // Deduce the specified type 't_TYPE' from the corresponding type supplied + // to the constructor of 'optional'. This guide does not participate in + // deduction unless the deduced type 't_TYPE' supports the bslma allocator + // model, and the specified 't_ALLOC' can be implicitly converted to // 'bsl::allocator'. -template ::value>, + BloombergLP::bslma::UsesBslmaAllocator::value>, class = typename bsl::enable_if_t< - bsl::is_convertible_v>> + bsl::is_convertible_v>> > -optional(bsl::allocator_arg_t, ALLOC, optional) --> optional; - // Deduce the specified type 'TYPE' from the corresponding template +optional(bsl::allocator_arg_t, t_ALLOC, optional) +-> optional; + // Deduce the specified type 't_TYPE' from the corresponding template // parameter type supplied to the constructor of 'optional'. This guide - // does not participate in deduction unless the deduced type 'TYPE' - // supports the bslma allocator model, and specified 'ALLOC' can be + // does not participate in deduction unless the deduced type 't_TYPE' + // supports the bslma allocator model, and the specified 't_ALLOC' can be // implicitly converted to 'bsl::allocator'. - # endif // BSLS_COMPILERFEATURES_SUPPORT_CTAD // ============================================================================ @@ -2358,28 +2364,27 @@ optional(bsl::allocator_arg_t, ALLOC, optional) // ============================================================================ // FREE FUNCTIONS -template -typename -bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs); +template +typename bsl::enable_if::value, + void>::type +swap(bsl::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee, 'lhs' and + // if the template parameter 't_TYPE' provides that guarantee, 'lhs' and // 'rhs' have equal allocators, and 'lhs.hasValue() == rhs.hasValue()'. -template -typename bsl::enable_if::value, +template +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs); +swap(bsl::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee and the result - // of the 'hasValue' method for 'lhs' and 'rhs' is the same. - + // if the template parameter 't_TYPE' provides that guarantee and the + // result of the 'hasValue' method for 'lhs' and 'rhs' is the same. // HASH SPECIALIZATIONS -template -void hashAppend(HASHALG& hashAlg, const optional& input); +template +void hashAppend(t_HASHALG& hashAlg, const optional& input); // Pass the specified 'input' to the specified 'hashAlg', where 'hashAlg' // is a hashing algorithm. @@ -2387,12 +2392,9 @@ void hashAppend(HASHALG& hashAlg, const optional& input); template bool operator==(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' and 'rhs' 'optional' objects have // the same value, and 'false' otherwise. Two 'optional' objects have the // same value if both are disengaged, or if both are engaged and the values @@ -2401,12 +2403,9 @@ bool operator==(const bsl::optional& lhs, template bool operator!=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' and 'rhs' 'optional' objects do not // have the same value, and 'false' otherwise. Two 'optional' objects do // not have the same value if one is disengaged and the other is engaged, @@ -2416,12 +2415,9 @@ bool operator!=(const bsl::optional& lhs, template bool operator<(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is // ordered before 'rhs' if 'lhs' is disengaged and 'rhs' is engaged or if @@ -2430,12 +2426,9 @@ bool operator<(const bsl::optional& lhs, template bool operator>(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is // ordered after 'rhs' if 'lhs' is engaged and 'rhs' is disengaged or if @@ -2444,12 +2437,9 @@ bool operator>(const bsl::optional& lhs, template bool operator<=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' 'optional' object or if 'lhs' and 'rhs' have the // same value, and 'false' otherwise. (See 'operator<' and 'operator=='.) @@ -2457,144 +2447,139 @@ bool operator<=(const bsl::optional& lhs, template bool operator>=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' 'optional' object or if 'lhs' and 'rhs' have the // same value, and 'false' otherwise. (See 'operator>' and 'operator=='.) // comparison with 'nullopt_t' -template +template BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - #if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \ defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) - -template +template BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) + BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; -template + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; +template BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) + BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::optional&, + const bsl::optional&, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; // Return 'false'. Note that 'bsl::nullopt_t' never orders after a // 'bsl::optional'. - -template +template BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. - // Note that 'bsl::nullopt_t' is ordered before any 'bsl::optional' that is - // engaged. + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; // Return 'false'. Note that 'bsl::nullopt_t' never orders after a // 'bsl::optional'. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true'. + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; + // Return 'true'. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::optional&, + const bsl::optional&, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true'. + // Return 'true'. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. #endif // !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && // defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) // comparison with 'value_type' template -bool operator==(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs == rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator==(const bsl::optional& lhs, + const t_RHS_TYPE& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); template -bool operator==(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs == *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator==(const t_LHS_TYPE& lhs, + const bsl::optional& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' and 'rhs' objects have the same // value, and 'false' otherwise. An 'optional' object and a value of some // type have the same value if the optional object is engaged and its // underlying value compares equal to the other value. template -bool operator!=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs != rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator!=(const bsl::optional& lhs, + const t_RHS_TYPE& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); template -bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs != *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator!=(const t_LHS_TYPE& lhs, + const bsl::optional& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' and 'rhs' objects do not have the // same value, and 'false' otherwise. An 'optional' object and a value of // some type do not have the same value if either the optional object is @@ -2603,119 +2588,94 @@ bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) template bool operator<(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs < rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs', and 'false' otherwise. 'lhs' is ordered before // 'rhs' if 'lhs' is disengaged or 'lhs.value()' is ordered before 'rhs'. template bool operator<(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs < *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is ordered before // 'rhs' if 'rhs' is engaged and 'lhs' is ordered before 'rhs.value()'. template bool operator>(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs > rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs', and 'false' otherwise. 'lhs' is ordered after // 'rhs' if 'lhs' is engaged and 'lhs.value()' is ordered after 'rhs'. template bool operator>(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs > *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered after the specified // 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is ordered after // 'rhs' if 'rhs' is disengaged or 'lhs' is ordered after 'rhs.value()'. template bool operator<=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs <= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' or 'lhs' and 'rhs' have the same value, and 'false' // otherwise. (See 'operator<' and 'operator=='.) template bool operator<=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs <= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' 'optional' object or 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator<' and 'operator=='.) template bool operator>=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs >= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' or if 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator>' and 'operator=='.) -; template bool operator>=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs >= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered after the specified // 'rhs' 'optional' object or if 'lhs' and 'rhs' have the same value, or // 'false' otherwise. (See 'operator>' and 'operator=='.) #if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \ && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - template t_RHS> constexpr compare_three_way_result_t operator<=>( const bsl::optional& lhs, @@ -2748,125 +2708,123 @@ constexpr compare_three_way_result_t operator<=>( // Perform a three-way comparison of the specified 'lhs' and the specified // 'rhs' objects by using the comparison operators of 't_LHS' and 't_RHS'; // return the result of that comparison. - #endif # ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template -typename bsl::enable_if::value, +template +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, std::optional& rhs); -template -typename bsl::enable_if::value, +swap(bsl::optional& lhs, std::optional& rhs); +template +typename bsl::enable_if::value, void>::type -swap(std::optional& lhs, bsl::optional& rhs); +swap(std::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee and the result - // of the 'hasValue' method for 'lhs' and 'rhs' is the same. + // if the template parameter 't_TYPE' provides that guarantee and the + // result of the 'hasValue' method for 'lhs' and 'rhs' is the same. // comparison with 'std::optional' -template -bool operator==(const std::optional& lhs, - const bsl::optional& rhs); -template -bool operator==(const bsl::optional& lhs, - const std::optional& rhs); +template +bool operator==(const std::optional& lhs, + const bsl::optional& rhs); +template +bool operator==(const bsl::optional& lhs, + const std::optional& rhs); // Return 'true' if the specified 'lhs' and 'rhs' optional objects have the // same value, and 'false' otherwise. Two optional objects have the same // value if both are disengaged, or if both are engaged and the values of // their underlying objects compare equal. Note that this function will - // fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are not compatible. - -template -bool operator!=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator!=(const std::optional& lhs, - const bsl::optional& rhs); + // fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' are not compatible. + +template +bool operator!=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator!=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' and 'rhs' optional objects do not // have the same value, and 'false' otherwise. Two optional objects do not // have the same value if one is disengaged and the other is engaged, or if // both are engaged and the values of their underlying objects do not // compare equal. Note that this function will fail to compile if - // 'LHS_TYPE' and 'RHS_TYPE' are not compatible. - -template -bool operator<(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator<(const std::optional& lhs, - const bsl::optional& rhs); + // 't_LHS_TYPE' and 't_RHS_TYPE' are not compatible. + +template +bool operator<(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator<(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered before // the specified 'rhs' optional object, and 'false' otherwise. 'lhs' is // ordered before 'rhs' if 'lhs' is disengaged and 'rhs' is engaged or if // both are engaged and 'lhs.value()' is ordered before 'rhs.value()'. - // Note that this function will fail to compile if 'LHS_TYPE' and - // 'RHS_TYPE' are not compatible. - -template -bool operator>(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator>(const std::optional& lhs, - const bsl::optional& rhs); + // Note that this function will fail to compile if 't_LHS_TYPE' and + // 't_RHS_TYPE' are not compatible. + +template +bool operator>(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator>(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered after // the specified 'rhs' optional object, and 'false' otherwise. 'lhs' is // ordered after 'rhs' if 'lhs' is engaged and 'rhs' is disengaged or if // both are engaged and 'lhs.value()' is ordered after 'rhs.value()'. Note - // that this function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are - // not compatible. - -template -bool operator<=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator<=(const std::optional& lhs, - const bsl::optional& rhs); + // that this function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' + // are not compatible. + +template +bool operator<=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator<=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' optional object or 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator<' and 'operator=='.) Note that this - // function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are not + // function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' are not // compatible. -template -bool operator>=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator>=(const std::optional& lhs, - const bsl::optional& rhs); +template +bool operator>=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator>=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered after // the specified 'rhs' optional object or 'lhs' and 'rhs' have the same // value, and 'false' otherwise. (See 'operator>' and 'operator=='.) Note - // that this function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are - // not compatible. - + // that this function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' + // are not compatible. #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> make_optional(bsl::allocator_arg_t, - typename bsl::optional< - typename bsl::decay::type>::allocator_type const&, - BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs); - // Return an 'optional' object containing a 'TYPE' object created by + const typename bsl::optional< + typename bsl::decay::type>::allocator_type& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' allocator-extended 'in_place_t' constructor // with the specified 'alloc' as the allocator argument, and specified // 'rhs' as the constructor argument. Note that this function will fail to - // compile if TYPE doesn't use allocators. + // compile if 't_TYPE' doesn't use allocators. #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); - // Return an 'optional' object containing a 'TYPE' object created by +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' allocator-extended 'in_place_t' constructor // with the specified 'alloc' as the allocator argument, and specified // 'args' as constructor arguments. Note that this function will fail to - // compile if TYPE doesn't use allocators. + // compile if 't_TYPE' doesn't use allocators. # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) @@ -2874,57 +2832,56 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( // that have an 'std::initializer_list' argument where the // 'std::initializer_list' element type is deduced. -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); - // Return an 'optional' object containing a 'TYPE' object created by +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' allocator-extended 'in_place_t' constructor // with the specified 'alloc' as the allocator argument, and specified 'il' // and 'args' as the constructor arguments. Note that this function will - // fail to compile if TYPE doesn't use allocators. + // fail to compile if 't_TYPE' doesn't use allocators. # endif // defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs); - // Return an 'optional' object containing a 'TYPE' object created by +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' constructor with the specified 'rhs' as the - // constructor argument. If TYPE uses an allocator, the default allocator - // will be used for the 'optional' object. + // constructor argument. If 't_TYPE' uses an allocator, the default + // allocator will be used for the 'optional' object. -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional(); - // Return an 'optional' object containing a default constructed 'TYPE' - // object. If TYPE uses an allocator, the default allocator will be used - // for the 'optional' object. +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional(); + // Return an 'optional' object containing a value-initialized 't_TYPE' + // object. If 't_TYPE' uses an allocator, the default allocator will be + // used for the 'optional' object. #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); // Return an 'optional' object containing a 'TYPE' object created by // invoking a 'bsl::optional' 'in_place_t' constructor with the specified - // arguments as the constructor arguments. If TYPE uses an allocator, the - // default allocator will be used for the 'optional' object. + // 'arg' and 'args' as the constructor arguments. If 't_TYPE' uses an + // allocator, the default allocator will be used for the 'optional' object. # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) // MSVC2013 has a bug that causes deduction issues in free template functions // that have an 'std::initializer_list' argument where the // 'std::initializer_list' element type is deduced. - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); - // Return an 'optional' object containing a 'TYPE' object created by +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' 'in_place_t' constructor with the specified - // 'il' and 'args' as the constructor arguments. If TYPE uses an + // 'il' and 'args' as the constructor arguments. If 't_TYPE' uses an // allocator, the default allocator will be used for the 'optional' object. # endif // defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) @@ -2948,52 +2905,52 @@ namespace bslstl { // ====================== // CREATORS -template -Optional_DataImp::Optional_DataImp() BSLS_KEYWORD_NOEXCEPT +template +Optional_DataImp::Optional_DataImp() BSLS_KEYWORD_NOEXCEPT : d_hasValue(false) { } // MANIPULATORS #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES -template -template +template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); d_hasValue = true; return d_buffer.object(); } # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); d_hasValue = true; return d_buffer.object(); } # endif // BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS #endif -template -void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT +template +void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT { if (d_hasValue) { d_hasValue = false; @@ -3002,9 +2959,9 @@ void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT } # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -TYPE& Optional_DataImp::value() & +t_TYPE& Optional_DataImp::value() & { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3012,9 +2969,9 @@ TYPE& Optional_DataImp::value() & return d_buffer.object(); } -template +template inline -TYPE&& Optional_DataImp::value() && +t_TYPE&& Optional_DataImp::value() && { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3022,9 +2979,9 @@ TYPE&& Optional_DataImp::value() && return std::move(d_buffer.object()); } # else // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -TYPE& Optional_DataImp::value() +t_TYPE& Optional_DataImp::value() { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3034,20 +2991,17 @@ TYPE& Optional_DataImp::value() # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else // ACCESSORS -template +template inline -bool Optional_DataImp::hasValue() const BSLS_KEYWORD_NOEXCEPT +bool Optional_DataImp::hasValue() const BSLS_KEYWORD_NOEXCEPT { - // We do not assert on an empty object in this function as the assert level - // is determined by the 'Optional_Base' method invoking 'value()' - return d_hasValue; } # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -const TYPE& Optional_DataImp::value() const& +const t_TYPE& Optional_DataImp::value() const& { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3055,9 +3009,9 @@ const TYPE& Optional_DataImp::value() const& return d_buffer.object(); } -template +template inline -const TYPE&& Optional_DataImp::value() const&& +const t_TYPE&& Optional_DataImp::value() const&& { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3065,9 +3019,9 @@ const TYPE&& Optional_DataImp::value() const&& return std::move(d_buffer.object()); } # else // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -const TYPE& Optional_DataImp::value() const +const t_TYPE& Optional_DataImp::value() const { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -3081,8 +3035,8 @@ const TYPE& Optional_DataImp::value() const // =================== // CREATORS -template -Optional_Data::~Optional_Data() +template +Optional_Data::~Optional_Data() { this->reset(); } @@ -5125,11 +5079,11 @@ optional::operator=(std::optional&& rhs) // Section: Free Function Definitions // ============================================================================ -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs) +swap(bsl::optional& lhs, bsl::optional& rhs) { if (lhs.get_allocator() == rhs.get_allocator()) { lhs.swap(rhs); @@ -5137,27 +5091,27 @@ swap(bsl::optional& lhs, bsl::optional& rhs) return; // RETURN } - bsl::optional futureLhs( + bsl::optional futureLhs( bsl::allocator_arg, lhs.get_allocator(), rhs); - bsl::optional futureRhs( + bsl::optional futureRhs( bsl::allocator_arg, rhs.get_allocator(), lhs); futureLhs.swap(lhs); futureRhs.swap(rhs); } -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs) +swap(bsl::optional& lhs, bsl::optional& rhs) { lhs.swap(rhs); } // HASH SPECIALIZATIONS -template -void hashAppend(HASHALG& hashAlg, const bsl::optional& input) +template +void hashAppend(t_HASHALG& hashAlg, const bsl::optional& input) { using ::BloombergLP::bslh::hashAppend; @@ -5175,11 +5129,9 @@ void hashAppend(HASHALG& hashAlg, const bsl::optional& input) template bool operator==(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; // RETURN @@ -5190,11 +5142,9 @@ bool operator==(const bsl::optional& lhs, template bool operator!=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; // RETURN @@ -5206,11 +5156,9 @@ bool operator!=(const bsl::optional& lhs, template bool operator<(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!rhs.has_value()) { return false; // RETURN @@ -5222,11 +5170,9 @@ bool operator<(const bsl::optional& lhs, template bool operator>(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!lhs.has_value()) { return false; // RETURN @@ -5238,11 +5184,9 @@ bool operator>(const bsl::optional& lhs, template bool operator<=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!lhs.has_value()) { return true; // RETURN @@ -5254,11 +5198,9 @@ bool operator<=(const bsl::optional& lhs, template bool operator>=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!rhs.has_value()) { return true; // RETURN @@ -5268,117 +5210,115 @@ bool operator>=(const bsl::optional& lhs, // comparison with 'nullopt_t' -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } #if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \ defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) - -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::optional&, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional&, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return false; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT { return false; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT { return true; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::optional&, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional&, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return true; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } - #endif // !(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS && // BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) @@ -5386,156 +5326,132 @@ BSLS_KEYWORD_CONSTEXPR bool operator>=( template bool operator==(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs == rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs == rhs; } template bool operator==(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs == *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs == *rhs; } template bool operator!=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs != rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs != rhs; } template bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs != *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs != *rhs; } template bool operator<(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs < rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs < rhs; } template bool operator<(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs < *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs < *rhs; } template bool operator>(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs > rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs > rhs; } template bool operator>(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs > *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs > *rhs; } template bool operator<=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs <= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs <= rhs; } template bool operator<=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs <= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs <= *rhs; } template bool operator>=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs >= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs >= rhs; } template bool operator>=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs >= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs >= *rhs; } @@ -5587,35 +5503,34 @@ constexpr compare_three_way_result_t operator<=>( } return lhs_has_value <=> rhs_has_value; } - #endif // BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && // BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS # ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, std::optional& rhs) +swap(bsl::optional& lhs, std::optional& rhs) { lhs.swap(rhs); } -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(std::optional& lhs, bsl::optional& rhs) +swap(std::optional& lhs, bsl::optional& rhs) { lhs.swap(rhs); } // comparison with 'std::optional' -template +template inline -bool operator==(const bsl::optional& lhs, - const std::optional& rhs) +bool operator==(const bsl::optional& lhs, + const std::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; @@ -5623,10 +5538,10 @@ bool operator==(const bsl::optional& lhs, return lhs.has_value() == rhs.has_value(); } -template +template inline -bool operator==(const std::optional& lhs, - const bsl::optional& rhs) +bool operator==(const std::optional& lhs, + const bsl::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; @@ -5634,10 +5549,10 @@ bool operator==(const std::optional& lhs, return lhs.has_value() == rhs.has_value(); } -template +template inline -bool operator!=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator!=(const bsl::optional& lhs, + const std::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; @@ -5646,10 +5561,10 @@ bool operator!=(const bsl::optional& lhs, return lhs.has_value() != rhs.has_value(); } -template +template inline -bool operator!=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator!=(const std::optional& lhs, + const bsl::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; @@ -5658,10 +5573,10 @@ bool operator!=(const std::optional& lhs, return lhs.has_value() != rhs.has_value(); } -template +template inline -bool operator<(const bsl::optional& lhs, - const std::optional& rhs) +bool operator<(const bsl::optional& lhs, + const std::optional& rhs) { if (!rhs.has_value()) { return false; // RETURN @@ -5670,10 +5585,10 @@ bool operator<(const bsl::optional& lhs, return !lhs.has_value() || *lhs < *rhs; } -template +template inline -bool operator<(const std::optional& lhs, - const bsl::optional& rhs) +bool operator<(const std::optional& lhs, + const bsl::optional& rhs) { if (!rhs.has_value()) { return false; // RETURN @@ -5682,10 +5597,10 @@ bool operator<(const std::optional& lhs, return !lhs.has_value() || *lhs < *rhs; } -template +template inline -bool operator>(const bsl::optional& lhs, - const std::optional& rhs) +bool operator>(const bsl::optional& lhs, + const std::optional& rhs) { if (!lhs.has_value()) { return false; // RETURN @@ -5694,10 +5609,10 @@ bool operator>(const bsl::optional& lhs, return !rhs.has_value() || *lhs > *rhs; } -template +template inline -bool operator>(const std::optional& lhs, - const bsl::optional& rhs) +bool operator>(const std::optional& lhs, + const bsl::optional& rhs) { if (!lhs.has_value()) { return false; // RETURN @@ -5706,10 +5621,10 @@ bool operator>(const std::optional& lhs, return !rhs.has_value() || *lhs > *rhs; } -template +template inline -bool operator<=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator<=(const bsl::optional& lhs, + const std::optional& rhs) { if (!lhs.has_value()) { return true; // RETURN @@ -5718,10 +5633,10 @@ bool operator<=(const bsl::optional& lhs, return rhs.has_value() && *lhs <= *rhs; } -template +template inline -bool operator<=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator<=(const std::optional& lhs, + const bsl::optional& rhs) { if (!lhs.has_value()) { return true; // RETURN @@ -5730,10 +5645,10 @@ bool operator<=(const std::optional& lhs, return rhs.has_value() && *lhs <= *rhs; } -template +template inline -bool operator>=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator>=(const bsl::optional& lhs, + const std::optional& rhs) { if (!rhs.has_value()) { return true; // RETURN @@ -5741,104 +5656,104 @@ bool operator>=(const bsl::optional& lhs, return lhs.has_value() && *lhs >= *rhs; } -template +template inline -bool operator>=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator>=(const std::optional& lhs, + const bsl::optional& rhs) { if (!rhs.has_value()) { return true; // RETURN } return lhs.has_value() && *lhs >= *rhs; } - # endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> make_optional(bsl::allocator_arg_t, - typename bsl::optional::type>:: - allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs) + const typename bsl::optional< + typename bsl::decay::type>::allocator_type& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs) { - return bsl::optional::type>( - bsl::allocator_arg, - alloc, - bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(TYPE, rhs)); + return bsl::optional::type>( + bsl::allocator_arg, + alloc, + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_TYPE, rhs)); } #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional( + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } #endif #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # endif // defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs) { - return bsl::optional::type>( - BSLS_COMPILERFEATURES_FORWARD(TYPE, rhs)); + return bsl::optional::type>( + BSLS_COMPILERFEATURES_FORWARD(t_TYPE, rhs)); } -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional() +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional() { - return bsl::optional(bsl::in_place); + return bsl::optional(bsl::in_place); } #if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::in_place, + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # endif // defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) #endif @@ -5916,6 +5831,7 @@ inline constexpr bool _Is_specialization_v, std::optional> = #undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED #undef BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG #undef BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG +#undef BSLSTL_OPTIONAL_REQUIRES #endif // End C++11 code diff --git a/groups/bsl/bslstl/bslstl_optional_cpp03.h b/groups/bsl/bslstl/bslstl_optional_cpp03.h index 785d6ea1d2..f652e432ef 100644 --- a/groups/bsl/bslstl/bslstl_optional_cpp03.h +++ b/groups/bsl/bslstl/bslstl_optional_cpp03.h @@ -21,7 +21,7 @@ // regions of C++11 code, then this header contains no code and is not // '#include'd in the original header. // -// Generated on Tue Aug 6 11:09:34 2024 +// Generated on Thu Aug 29 15:48:59 2024 // Command line: sim_cpp11_features.pl bslstl_optional.h #ifdef COMPILING_BSLSTL_OPTIONAL_H @@ -257,7 +257,7 @@ !bsl::is_same< \ typename bsl::remove_cvref::type, \ bsl::allocator_arg_t>::value, \ - optional >::type + optional >::type #ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULT_TEMPLATE_ARGS #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) = ARG @@ -265,6 +265,12 @@ #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) #endif +#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS + #define BSLSTL_OPTIONAL_REQUIRES(EXPR) requires(EXPR) +#else + #define BSLSTL_OPTIONAL_REQUIRES(EXPR) +#endif + namespace BloombergLP { namespace bslstl { struct Optional_NulloptConstructToken { @@ -335,26 +341,26 @@ namespace bslstl { # ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY -template +template struct Optional_IsTriviallyDestructible -: std::is_trivially_destructible { - // This metafunction is derived from 'std::is_trivially_destructible' - // in C++11 and later. In C++03, the metafunction is derived from - // 'bsl::is_trivially_copyable', a trait that implies the type is also - // trivially destructible. +: std::is_trivially_destructible { + // This metafunction is derived from + // 'std::is_trivially_destructible' in C++11 and later. In C++03, + // the metafunction is derived from 'bsl::is_trivially_copyable', a trait + // that implies the type is also trivially destructible. }; # else // BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY -template -struct Optional_IsTriviallyDestructible : bslmf::IsBitwiseCopyable { +template +struct Optional_IsTriviallyDestructible : bslmf::IsBitwiseCopyable { // C++03 does not provide a trivially destructible trait. Instead we use // 'bslmf::IsBitwiseCopyable' which implies the type is also trivially // destructible. // // Note that we use 'bslmf::IsBitwiseCopyable' here and not // 'bsl::is_trivially_copyable' because on some platforms, the native - // 'std::is_trivially_copyable>' is 'false' + // 'std::is_trivially_copyable>' is 'false' // even though it has no d'tor and 'TYPE' is trivally copyable. }; @@ -391,14 +397,16 @@ BSLS_KEYWORD_CONSTEXPR Optional_OptNoSuchType::Optional_OptNoSuchType( // class Optional_PropagatesAllocator // ================================== -template +template struct Optional_PropagatesAllocator : bsl::integral_constant< bool, - bslma::UsesBslmaAllocator::value && bsl::is_const::value && - bsl::is_same::type>::value> { - // This metafunction is derived from 'bsl::true_type' if 'TYPE' is an - // allocator-aware const type, and if 'ANY_TYPE' is the same as 'TYPE', + bslma::UsesBslmaAllocator::value && + bsl::is_const::value && + bsl::is_same::type>::value> { + // This metafunction is derived from 'bsl::true_type' if 't_TYPE' is an + // allocator-aware const type, and if 't_ANY_TYPE' is the same as 't_TYPE', // minus the cv qualification. This trait is used to enable a constructor // overload for a const qualified allocator-aware 'ValueType' taking an // rvalue of Optional_Base of the non-const qualified 'ValueType'. Such an @@ -442,7 +450,7 @@ struct Optional_MoveConstructFromStdOptional {}; // class Optional_DataImp // ====================== -template +template struct Optional_DataImp { // This component-private 'struct' manages a 'value_type' object in an // 'Optional_Base' object. This class provides an abstraction for 'const' @@ -456,7 +464,7 @@ struct Optional_DataImp { private: // PRIVATE TYPES - typedef typename bsl::remove_const::type StoredType; + typedef typename bsl::remove_const::type StoredType; // DATA bsls::ObjectBuffer d_buffer; @@ -481,342 +489,352 @@ struct Optional_DataImp { #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_A BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0 - TYPE& emplace(bslma::Allocator *allocator); + t_TYPE& emplace(bslma::Allocator *allocator); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10 - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10)); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10 # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10 - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10)); + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10 - # endif #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. - template - TYPE& emplace(bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); + template + t_TYPE& emplace(bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) - template - TYPE& emplace(bslma::Allocator *allocator, - std::initializer_list initializer_list, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); - + template + t_TYPE& emplace( + bslma::Allocator *allocator, + std::initializer_list initializer_list, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # endif // }}} END GENERATED CODE #endif @@ -825,15 +843,15 @@ struct Optional_DataImp { // Destroy the 'value_type' object in 'd_buffer', if any. # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS - TYPE& value() &; - TYPE&& value() &&; + t_TYPE& value() &; + t_TYPE&& value() &&; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # else - TYPE& value(); + t_TYPE& value(); // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else @@ -842,16 +860,16 @@ struct Optional_DataImp { // Return 'true' if this objects has a value, and 'false' otherwise. # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS - const TYPE& value() const &; - const TYPE&& value() const &&; + const t_TYPE& value() const &; + const t_TYPE&& value() const &&; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # else - const TYPE& value() const; + const t_TYPE& value() const; // Return the 'value_type' object in 'd_buffer' with const - // qualification adjusted to match that of 'TYPE'. The behavior is + // qualification adjusted to match that of 't_TYPE'. The behavior is // undefined unless 'this->hasValue() == true'. # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else }; @@ -861,14 +879,14 @@ struct Optional_DataImp { // =================== template < - class TYPE, - bool IS_TRIVIALLY_DESTRUCTIBLE = - bslstl::Optional_IsTriviallyDestructible::value> -struct Optional_Data : public Optional_DataImp { + class t_TYPE, + bool t_IS_TRIVIALLY_DESTRUCTIBLE = + bslstl::Optional_IsTriviallyDestructible::value> +struct Optional_Data : public Optional_DataImp { // This component-private 'struct' manages a 'value_type' object in // 'Optional_Base' by inheriting from `Optional_DataImp`. In addition, - // this primary template properly destroys the owned instance of 'TYPE' in - // its destructor. + // this primary template properly destroys the owned instance of 't_TYPE' + // in its destructor. public: // CREATORS @@ -880,8 +898,8 @@ struct Optional_Data : public Optional_DataImp { // class Optional_Data // =================== -template -struct Optional_Data : public Optional_DataImp { +template +struct Optional_Data : public Optional_DataImp { // This partial specialization manages a trivially destructible // 'value_type' in Optional_Base. It does not have a user-provided // destructor, which makes it 'is_trivially_destructible' itself. @@ -889,7 +907,7 @@ struct Optional_Data : public Optional_DataImp { public: BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Data, bslmf::IsBitwiseCopyable, - bslmf::IsBitwiseCopyable::value); + bslmf::IsBitwiseCopyable::value); }; // ========================== @@ -5216,41 +5234,40 @@ namespace bsl { # ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD // CLASS TEMPLATE DEDUCTION GUIDES -template -optional(TYPE) -> optional; - // Deduce the specified type 'TYPE' from the corresponding type supplied to - // the constructor of 'optional'. +template +optional(t_TYPE) -> optional; + // Deduce the specified type 't_TYPE' from the corresponding type supplied + // to the constructor of 'optional'. -template ::value>, + BloombergLP::bslma::UsesBslmaAllocator::value>, class = typename bsl::enable_if_t< - bsl::is_convertible_v>> + bsl::is_convertible_v>> > -optional(bsl::allocator_arg_t, ALLOC, TYPE) --> optional; - // Deduce the specified type 'TYPE' from the corresponding type supplied to - // the constructor of 'optional'. This guide does not participate in - // deduction unless the deduced type 'TYPE' supports the bslma allocator - // model, and specified 'ALLOC' can be implicitly converted to +optional(bsl::allocator_arg_t, t_ALLOC, t_TYPE) +-> optional; + // Deduce the specified type 't_TYPE' from the corresponding type supplied + // to the constructor of 'optional'. This guide does not participate in + // deduction unless the deduced type 't_TYPE' supports the bslma allocator + // model, and the specified 't_ALLOC' can be implicitly converted to // 'bsl::allocator'. -template ::value>, + BloombergLP::bslma::UsesBslmaAllocator::value>, class = typename bsl::enable_if_t< - bsl::is_convertible_v>> + bsl::is_convertible_v>> > -optional(bsl::allocator_arg_t, ALLOC, optional) --> optional; - // Deduce the specified type 'TYPE' from the corresponding template +optional(bsl::allocator_arg_t, t_ALLOC, optional) +-> optional; + // Deduce the specified type 't_TYPE' from the corresponding template // parameter type supplied to the constructor of 'optional'. This guide - // does not participate in deduction unless the deduced type 'TYPE' - // supports the bslma allocator model, and specified 'ALLOC' can be + // does not participate in deduction unless the deduced type 't_TYPE' + // supports the bslma allocator model, and the specified 't_ALLOC' can be // implicitly converted to 'bsl::allocator'. - # endif // BSLS_COMPILERFEATURES_SUPPORT_CTAD // ============================================================================ @@ -5258,28 +5275,27 @@ optional(bsl::allocator_arg_t, ALLOC, optional) // ============================================================================ // FREE FUNCTIONS -template -typename -bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs); +template +typename bsl::enable_if::value, + void>::type +swap(bsl::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee, 'lhs' and + // if the template parameter 't_TYPE' provides that guarantee, 'lhs' and // 'rhs' have equal allocators, and 'lhs.hasValue() == rhs.hasValue()'. -template -typename bsl::enable_if::value, +template +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs); +swap(bsl::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee and the result - // of the 'hasValue' method for 'lhs' and 'rhs' is the same. - + // if the template parameter 't_TYPE' provides that guarantee and the + // result of the 'hasValue' method for 'lhs' and 'rhs' is the same. // HASH SPECIALIZATIONS -template -void hashAppend(HASHALG& hashAlg, const optional& input); +template +void hashAppend(t_HASHALG& hashAlg, const optional& input); // Pass the specified 'input' to the specified 'hashAlg', where 'hashAlg' // is a hashing algorithm. @@ -5287,12 +5303,9 @@ void hashAppend(HASHALG& hashAlg, const optional& input); template bool operator==(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' and 'rhs' 'optional' objects have // the same value, and 'false' otherwise. Two 'optional' objects have the // same value if both are disengaged, or if both are engaged and the values @@ -5301,12 +5314,9 @@ bool operator==(const bsl::optional& lhs, template bool operator!=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' and 'rhs' 'optional' objects do not // have the same value, and 'false' otherwise. Two 'optional' objects do // not have the same value if one is disengaged and the other is engaged, @@ -5316,12 +5326,9 @@ bool operator!=(const bsl::optional& lhs, template bool operator<(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is // ordered before 'rhs' if 'lhs' is disengaged and 'rhs' is engaged or if @@ -5330,12 +5337,9 @@ bool operator<(const bsl::optional& lhs, template bool operator>(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is // ordered after 'rhs' if 'lhs' is engaged and 'rhs' is disengaged or if @@ -5344,12 +5348,9 @@ bool operator>(const bsl::optional& lhs, template bool operator<=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' 'optional' object or if 'lhs' and 'rhs' have the // same value, and 'false' otherwise. (See 'operator<' and 'operator=='.) @@ -5357,144 +5358,139 @@ bool operator<=(const bsl::optional& lhs, template bool operator>=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' 'optional' object or if 'lhs' and 'rhs' have the // same value, and 'false' otherwise. (See 'operator>' and 'operator=='.) // comparison with 'nullopt_t' -template +template BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - #if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \ defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) - -template +template BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) + BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; -template + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; +template BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) + BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::optional&, + const bsl::optional&, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; // Return 'false'. Note that 'bsl::nullopt_t' never orders after a // 'bsl::optional'. - -template +template BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. - // Note that 'bsl::nullopt_t' is ordered before any 'bsl::optional' that is - // engaged. + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is engaged, and 'false' otherwise. + // Return 'true' if the specified 'value' is engaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; // Return 'false'. Note that 'bsl::nullopt_t' never orders after a // 'bsl::optional'. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::optional& value, + const bsl::optional& value, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. -template +template BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true'. + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT; + // Return 'true'. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::optional&, + const bsl::optional&, const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT; - // Return 'true'. + // Return 'true'. Note that 'bsl::nullopt_t' is ordered before any + // 'bsl::optional' that is engaged. -template +template BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; - // Return 'true' if specified 'value' is disengaged, and 'false' otherwise. + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT; + // Return 'true' if the specified 'value' is disengaged, and 'false' + // otherwise. #endif // !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && // defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) // comparison with 'value_type' template -bool operator==(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs == rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator==(const bsl::optional& lhs, + const t_RHS_TYPE& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); template -bool operator==(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs == *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator==(const t_LHS_TYPE& lhs, + const bsl::optional& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' and 'rhs' objects have the same // value, and 'false' otherwise. An 'optional' object and a value of some // type have the same value if the optional object is engaged and its // underlying value compares equal to the other value. template -bool operator!=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs != rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator!=(const bsl::optional& lhs, + const t_RHS_TYPE& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); template -bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs != *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; +bool operator!=(const t_LHS_TYPE& lhs, + const bsl::optional& rhs) + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' and 'rhs' objects do not have the // same value, and 'false' otherwise. An 'optional' object and a value of // some type do not have the same value if either the optional object is @@ -5503,119 +5499,94 @@ bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) template bool operator<(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs < rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs', and 'false' otherwise. 'lhs' is ordered before // 'rhs' if 'lhs' is disengaged or 'lhs.value()' is ordered before 'rhs'. template bool operator<(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs < *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is ordered before // 'rhs' if 'rhs' is engaged and 'lhs' is ordered before 'rhs.value()'. template bool operator>(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs > rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs', and 'false' otherwise. 'lhs' is ordered after // 'rhs' if 'lhs' is engaged and 'lhs.value()' is ordered after 'rhs'. template bool operator>(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs > *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered after the specified // 'rhs' 'optional' object, and 'false' otherwise. 'lhs' is ordered after // 'rhs' if 'rhs' is disengaged or 'lhs' is ordered after 'rhs.value()'. template bool operator<=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs <= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered before // the specified 'rhs' or 'lhs' and 'rhs' have the same value, and 'false' // otherwise. (See 'operator<' and 'operator=='.) template bool operator<=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs <= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' 'optional' object or 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator<' and 'operator=='.) template bool operator>=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs >= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' 'optional' object is ordered after // the specified 'rhs' or if 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator>' and 'operator=='.) -; template bool operator>=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs >= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif -; + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }); // Return 'true' if the specified 'lhs' is ordered after the specified // 'rhs' 'optional' object or if 'lhs' and 'rhs' have the same value, or // 'false' otherwise. (See 'operator>' and 'operator=='.) #if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \ && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - template t_RHS> constexpr compare_three_way_result_t operator<=>( const bsl::optional& lhs, @@ -5648,113 +5619,111 @@ constexpr compare_three_way_result_t operator<=>( // Perform a three-way comparison of the specified 'lhs' and the specified // 'rhs' objects by using the comparison operators of 't_LHS' and 't_RHS'; // return the result of that comparison. - #endif # ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template -typename bsl::enable_if::value, +template +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, std::optional& rhs); -template -typename bsl::enable_if::value, +swap(bsl::optional& lhs, std::optional& rhs); +template +typename bsl::enable_if::value, void>::type -swap(std::optional& lhs, bsl::optional& rhs); +swap(std::optional& lhs, bsl::optional& rhs); // Efficiently exchange the values of the specified 'lhs' and 'rhs' // objects. This method provides the no-throw exception-safety guarantee - // if the template parameter 'TYPE' provides that guarantee and the result - // of the 'hasValue' method for 'lhs' and 'rhs' is the same. + // if the template parameter 't_TYPE' provides that guarantee and the + // result of the 'hasValue' method for 'lhs' and 'rhs' is the same. // comparison with 'std::optional' -template -bool operator==(const std::optional& lhs, - const bsl::optional& rhs); -template -bool operator==(const bsl::optional& lhs, - const std::optional& rhs); +template +bool operator==(const std::optional& lhs, + const bsl::optional& rhs); +template +bool operator==(const bsl::optional& lhs, + const std::optional& rhs); // Return 'true' if the specified 'lhs' and 'rhs' optional objects have the // same value, and 'false' otherwise. Two optional objects have the same // value if both are disengaged, or if both are engaged and the values of // their underlying objects compare equal. Note that this function will - // fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are not compatible. - -template -bool operator!=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator!=(const std::optional& lhs, - const bsl::optional& rhs); + // fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' are not compatible. + +template +bool operator!=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator!=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' and 'rhs' optional objects do not // have the same value, and 'false' otherwise. Two optional objects do not // have the same value if one is disengaged and the other is engaged, or if // both are engaged and the values of their underlying objects do not // compare equal. Note that this function will fail to compile if - // 'LHS_TYPE' and 'RHS_TYPE' are not compatible. - -template -bool operator<(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator<(const std::optional& lhs, - const bsl::optional& rhs); + // 't_LHS_TYPE' and 't_RHS_TYPE' are not compatible. + +template +bool operator<(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator<(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered before // the specified 'rhs' optional object, and 'false' otherwise. 'lhs' is // ordered before 'rhs' if 'lhs' is disengaged and 'rhs' is engaged or if // both are engaged and 'lhs.value()' is ordered before 'rhs.value()'. - // Note that this function will fail to compile if 'LHS_TYPE' and - // 'RHS_TYPE' are not compatible. - -template -bool operator>(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator>(const std::optional& lhs, - const bsl::optional& rhs); + // Note that this function will fail to compile if 't_LHS_TYPE' and + // 't_RHS_TYPE' are not compatible. + +template +bool operator>(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator>(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered after // the specified 'rhs' optional object, and 'false' otherwise. 'lhs' is // ordered after 'rhs' if 'lhs' is engaged and 'rhs' is disengaged or if // both are engaged and 'lhs.value()' is ordered after 'rhs.value()'. Note - // that this function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are - // not compatible. - -template -bool operator<=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator<=(const std::optional& lhs, - const bsl::optional& rhs); + // that this function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' + // are not compatible. + +template +bool operator<=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator<=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' is ordered before the specified // 'rhs' optional object or 'lhs' and 'rhs' have the same value, and // 'false' otherwise. (See 'operator<' and 'operator=='.) Note that this - // function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are not + // function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' are not // compatible. -template -bool operator>=(const bsl::optional& lhs, - const std::optional& rhs); -template -bool operator>=(const std::optional& lhs, - const bsl::optional& rhs); +template +bool operator>=(const bsl::optional& lhs, + const std::optional& rhs); +template +bool operator>=(const std::optional& lhs, + const bsl::optional& rhs); // Return 'true' if the specified 'lhs' optional object is ordered after // the specified 'rhs' optional object or 'lhs' and 'rhs' have the same // value, and 'false' otherwise. (See 'operator>' and 'operator=='.) Note - // that this function will fail to compile if 'LHS_TYPE' and 'RHS_TYPE' are - // not compatible. - + // that this function will fail to compile if 't_LHS_TYPE' and 't_RHS_TYPE' + // are not compatible. #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> make_optional(bsl::allocator_arg_t, - typename bsl::optional< - typename bsl::decay::type>::allocator_type const&, - BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs); - // Return an 'optional' object containing a 'TYPE' object created by + const typename bsl::optional< + typename bsl::decay::type>::allocator_type& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' allocator-extended 'in_place_t' constructor // with the specified 'alloc' as the allocator argument, and specified // 'rhs' as the constructor argument. Note that this function will fail to - // compile if TYPE doesn't use allocators. + // compile if 't_TYPE' doesn't use allocators. #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES // {{{ BEGIN GENERATED CODE @@ -5766,180 +5735,180 @@ make_optional(bsl::allocator_arg_t, #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_J BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10 @@ -5947,229 +5916,229 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10 # endif #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # endif // }}} END GENERATED CODE #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs); - // Return an 'optional' object containing a 'TYPE' object created by +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs); + // Return an 'optional' object containing a 't_TYPE' object created by // invoking a 'bsl::optional' constructor with the specified 'rhs' as the - // constructor argument. If TYPE uses an allocator, the default allocator - // will be used for the 'optional' object. + // constructor argument. If 't_TYPE' uses an allocator, the default + // allocator will be used for the 'optional' object. -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional(); - // Return an 'optional' object containing a default constructed 'TYPE' - // object. If TYPE uses an allocator, the default allocator will be used - // for the 'optional' object. +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional(); + // Return an 'optional' object containing a value-initialized 't_TYPE' + // object. If 't_TYPE' uses an allocator, the default allocator will be + // used for the 'optional' object. #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES // {{{ BEGIN GENERATED CODE @@ -6181,339 +6150,338 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional(); #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_K BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10 # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10); #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10 @@ -6521,18 +6489,17 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG), - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args); +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args); # endif // }}} END GENERATED CODE @@ -6556,8 +6523,8 @@ namespace bslstl { // ====================== // CREATORS -template -Optional_DataImp::Optional_DataImp() BSLS_KEYWORD_NOEXCEPT +template +Optional_DataImp::Optional_DataImp() BSLS_KEYWORD_NOEXCEPT : d_hasValue(false) { } @@ -6573,10 +6540,10 @@ Optional_DataImp::Optional_DataImp() BSLS_KEYWORD_NOEXCEPT #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_L BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0 -template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator) { reset(); BloombergLP::bslma::ConstructionUtil::construct( @@ -6588,315 +6555,315 @@ TYPE& Optional_DataImp::emplace( #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1 -template -template +template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2 -template -template +template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3 -template -template +template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 10 -template -template -inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) +template +template +inline +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); d_hasValue = true; return d_buffer.object(); } @@ -6905,11 +6872,11 @@ TYPE& Optional_DataImp::emplace( # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il) { reset(); BloombergLP::bslma::ConstructionUtil::construct( @@ -6922,325 +6889,325 @@ TYPE& Optional_DataImp::emplace( #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); d_hasValue = true; return d_buffer.object(); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 10 -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); d_hasValue = true; return d_buffer.object(); } @@ -7250,36 +7217,36 @@ TYPE& Optional_DataImp::emplace( #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. -template -template +template +template inline -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); d_hasValue = true; return d_buffer.object(); } # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) -template -template -TYPE& Optional_DataImp::emplace( - bslma::Allocator *allocator, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +template +t_TYPE& Optional_DataImp::emplace( + bslma::Allocator *allocator, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { reset(); BloombergLP::bslma::ConstructionUtil::construct( d_buffer.address(), allocator, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); d_hasValue = true; return d_buffer.object(); } @@ -7287,8 +7254,8 @@ TYPE& Optional_DataImp::emplace( // }}} END GENERATED CODE #endif -template -void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT +template +void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT { if (d_hasValue) { d_hasValue = false; @@ -7297,9 +7264,9 @@ void Optional_DataImp::reset() BSLS_KEYWORD_NOEXCEPT } # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -TYPE& Optional_DataImp::value() & +t_TYPE& Optional_DataImp::value() & { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7307,9 +7274,9 @@ TYPE& Optional_DataImp::value() & return d_buffer.object(); } -template +template inline -TYPE&& Optional_DataImp::value() && +t_TYPE&& Optional_DataImp::value() && { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7317,9 +7284,9 @@ TYPE&& Optional_DataImp::value() && return std::move(d_buffer.object()); } # else // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -TYPE& Optional_DataImp::value() +t_TYPE& Optional_DataImp::value() { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7329,20 +7296,17 @@ TYPE& Optional_DataImp::value() # endif // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS else // ACCESSORS -template +template inline -bool Optional_DataImp::hasValue() const BSLS_KEYWORD_NOEXCEPT +bool Optional_DataImp::hasValue() const BSLS_KEYWORD_NOEXCEPT { - // We do not assert on an empty object in this function as the assert level - // is determined by the 'Optional_Base' method invoking 'value()' - return d_hasValue; } # ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -const TYPE& Optional_DataImp::value() const& +const t_TYPE& Optional_DataImp::value() const& { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7350,9 +7314,9 @@ const TYPE& Optional_DataImp::value() const& return d_buffer.object(); } -template +template inline -const TYPE&& Optional_DataImp::value() const&& +const t_TYPE&& Optional_DataImp::value() const&& { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7360,9 +7324,9 @@ const TYPE&& Optional_DataImp::value() const&& return std::move(d_buffer.object()); } # else // BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS -template +template inline -const TYPE& Optional_DataImp::value() const +const t_TYPE& Optional_DataImp::value() const { // We do not assert on an empty object in this function as the assert level // is determined by the 'Optional_Base' method invoking 'value()' @@ -7376,8 +7340,8 @@ const TYPE& Optional_DataImp::value() const // =================== // CREATORS -template -Optional_Data::~Optional_Data() +template +Optional_Data::~Optional_Data() { this->reset(); } @@ -13946,11 +13910,11 @@ optional::operator=(std::optional&& rhs) // Section: Free Function Definitions // ============================================================================ -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs) +swap(bsl::optional& lhs, bsl::optional& rhs) { if (lhs.get_allocator() == rhs.get_allocator()) { lhs.swap(rhs); @@ -13958,27 +13922,27 @@ swap(bsl::optional& lhs, bsl::optional& rhs) return; // RETURN } - bsl::optional futureLhs( + bsl::optional futureLhs( bsl::allocator_arg, lhs.get_allocator(), rhs); - bsl::optional futureRhs( + bsl::optional futureRhs( bsl::allocator_arg, rhs.get_allocator(), lhs); futureLhs.swap(lhs); futureRhs.swap(rhs); } -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, bsl::optional& rhs) +swap(bsl::optional& lhs, bsl::optional& rhs) { lhs.swap(rhs); } // HASH SPECIALIZATIONS -template -void hashAppend(HASHALG& hashAlg, const bsl::optional& input) +template +void hashAppend(t_HASHALG& hashAlg, const bsl::optional& input) { using ::BloombergLP::bslh::hashAppend; @@ -13996,11 +13960,9 @@ void hashAppend(HASHALG& hashAlg, const bsl::optional& input) template bool operator==(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; // RETURN @@ -14011,11 +13973,9 @@ bool operator==(const bsl::optional& lhs, template bool operator!=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; // RETURN @@ -14027,11 +13987,9 @@ bool operator!=(const bsl::optional& lhs, template bool operator<(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!rhs.has_value()) { return false; // RETURN @@ -14043,11 +14001,9 @@ bool operator<(const bsl::optional& lhs, template bool operator>(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!lhs.has_value()) { return false; // RETURN @@ -14059,11 +14015,9 @@ bool operator>(const bsl::optional& lhs, template bool operator<=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!lhs.has_value()) { return true; // RETURN @@ -14075,11 +14029,9 @@ bool operator<=(const bsl::optional& lhs, template bool operator>=(const bsl::optional& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires requires { + BSLSTL_OPTIONAL_REQUIRES(requires { { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + }) { if (!rhs.has_value()) { return true; // RETURN @@ -14089,117 +14041,115 @@ bool operator>=(const bsl::optional& lhs, // comparison with 'nullopt_t' -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } #if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \ defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS)) - -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator==( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator!=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::optional&, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional&, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return false; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT { return false; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::optional& value, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional& value, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator<=( - const bsl::nullopt_t&, - const bsl::optional&) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional&) BSLS_KEYWORD_NOEXCEPT { return true; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::optional&, - const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT + const bsl::optional&, + const bsl::nullopt_t&) BSLS_KEYWORD_NOEXCEPT { return true; } -template +template inline BSLS_KEYWORD_CONSTEXPR bool operator>=( - const bsl::nullopt_t&, - const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT + const bsl::nullopt_t&, + const bsl::optional& value) BSLS_KEYWORD_NOEXCEPT { return !value.has_value(); } - #endif // !(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS && // BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) @@ -14207,156 +14157,132 @@ BSLS_KEYWORD_CONSTEXPR bool operator>=( template bool operator==(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs == rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs == rhs; } template bool operator==(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs == *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs == *rhs; } template bool operator!=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs != rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs != rhs; } template bool operator!=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs != *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs != *rhs; } template bool operator<(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs < rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs < rhs; } template bool operator<(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs < *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs < *rhs; } template bool operator>(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs > rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs > rhs; } template bool operator>(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs > *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs > *rhs; } template bool operator<=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs <= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !lhs.has_value() || *lhs <= rhs; } template bool operator<=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs <= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return rhs.has_value() && lhs <= *rhs; } template bool operator>=(const bsl::optional& lhs, const t_RHS_TYPE& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { *lhs >= rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return lhs.has_value() && *lhs >= rhs; } template bool operator>=(const t_LHS_TYPE& lhs, const bsl::optional& rhs) -#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS - requires (!BloombergLP::bslstl::Optional_DerivedFromOptional) - && requires { - { lhs >= *rhs } -> - BloombergLP::bslstl::Optional_ConvertibleToBool; - } -#endif + BSLSTL_OPTIONAL_REQUIRES( + !BloombergLP::bslstl::Optional_DerivedFromOptional + && requires { + { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool; + }) { return !rhs.has_value() || lhs >= *rhs; } @@ -14408,35 +14334,34 @@ constexpr compare_three_way_result_t operator<=>( } return lhs_has_value <=> rhs_has_value; } - #endif // BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && // BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS # ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(bsl::optional& lhs, std::optional& rhs) +swap(bsl::optional& lhs, std::optional& rhs) { lhs.swap(rhs); } -template +template inline -typename bsl::enable_if::value, +typename bsl::enable_if::value, void>::type -swap(std::optional& lhs, bsl::optional& rhs) +swap(std::optional& lhs, bsl::optional& rhs) { lhs.swap(rhs); } // comparison with 'std::optional' -template +template inline -bool operator==(const bsl::optional& lhs, - const std::optional& rhs) +bool operator==(const bsl::optional& lhs, + const std::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; @@ -14444,10 +14369,10 @@ bool operator==(const bsl::optional& lhs, return lhs.has_value() == rhs.has_value(); } -template +template inline -bool operator==(const std::optional& lhs, - const bsl::optional& rhs) +bool operator==(const std::optional& lhs, + const bsl::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs == *rhs; @@ -14455,10 +14380,10 @@ bool operator==(const std::optional& lhs, return lhs.has_value() == rhs.has_value(); } -template +template inline -bool operator!=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator!=(const bsl::optional& lhs, + const std::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; @@ -14467,10 +14392,10 @@ bool operator!=(const bsl::optional& lhs, return lhs.has_value() != rhs.has_value(); } -template +template inline -bool operator!=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator!=(const std::optional& lhs, + const bsl::optional& rhs) { if (lhs.has_value() && rhs.has_value()) { return *lhs != *rhs; @@ -14479,10 +14404,10 @@ bool operator!=(const std::optional& lhs, return lhs.has_value() != rhs.has_value(); } -template +template inline -bool operator<(const bsl::optional& lhs, - const std::optional& rhs) +bool operator<(const bsl::optional& lhs, + const std::optional& rhs) { if (!rhs.has_value()) { return false; // RETURN @@ -14491,10 +14416,10 @@ bool operator<(const bsl::optional& lhs, return !lhs.has_value() || *lhs < *rhs; } -template +template inline -bool operator<(const std::optional& lhs, - const bsl::optional& rhs) +bool operator<(const std::optional& lhs, + const bsl::optional& rhs) { if (!rhs.has_value()) { return false; // RETURN @@ -14503,10 +14428,10 @@ bool operator<(const std::optional& lhs, return !lhs.has_value() || *lhs < *rhs; } -template +template inline -bool operator>(const bsl::optional& lhs, - const std::optional& rhs) +bool operator>(const bsl::optional& lhs, + const std::optional& rhs) { if (!lhs.has_value()) { return false; // RETURN @@ -14515,10 +14440,10 @@ bool operator>(const bsl::optional& lhs, return !rhs.has_value() || *lhs > *rhs; } -template +template inline -bool operator>(const std::optional& lhs, - const bsl::optional& rhs) +bool operator>(const std::optional& lhs, + const bsl::optional& rhs) { if (!lhs.has_value()) { return false; // RETURN @@ -14527,10 +14452,10 @@ bool operator>(const std::optional& lhs, return !rhs.has_value() || *lhs > *rhs; } -template +template inline -bool operator<=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator<=(const bsl::optional& lhs, + const std::optional& rhs) { if (!lhs.has_value()) { return true; // RETURN @@ -14539,10 +14464,10 @@ bool operator<=(const bsl::optional& lhs, return rhs.has_value() && *lhs <= *rhs; } -template +template inline -bool operator<=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator<=(const std::optional& lhs, + const bsl::optional& rhs) { if (!lhs.has_value()) { return true; // RETURN @@ -14551,10 +14476,10 @@ bool operator<=(const std::optional& lhs, return rhs.has_value() && *lhs <= *rhs; } -template +template inline -bool operator>=(const bsl::optional& lhs, - const std::optional& rhs) +bool operator>=(const bsl::optional& lhs, + const std::optional& rhs) { if (!rhs.has_value()) { return true; // RETURN @@ -14562,31 +14487,30 @@ bool operator>=(const bsl::optional& lhs, return lhs.has_value() && *lhs >= *rhs; } -template +template inline -bool operator>=(const std::optional& lhs, - const bsl::optional& rhs) +bool operator>=(const std::optional& lhs, + const bsl::optional& rhs) { if (!rhs.has_value()) { return true; // RETURN } return lhs.has_value() && *lhs >= *rhs; } - # endif // BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> make_optional(bsl::allocator_arg_t, - typename bsl::optional::type>:: - allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs) + const typename bsl::optional< + typename bsl::decay::type>::allocator_type& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs) { - return bsl::optional::type>( - bsl::allocator_arg, - alloc, - bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(TYPE, rhs)); + return bsl::optional::type>( + bsl::allocator_arg, + alloc, + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_TYPE, rhs)); } #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES @@ -14599,12 +14523,12 @@ make_optional(bsl::allocator_arg_t, #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_U BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc) { - return bsl::optional( + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place); @@ -14612,304 +14536,304 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { - return bsl::optional( + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) -{ - return bsl::optional( +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) +{ + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 10 #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional( + return bsl::optional( bsl::allocator_arg, alloc, bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } // }}} END GENERATED CODE #endif @@ -14925,15 +14849,15 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( #endif # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il); @@ -14941,297 +14865,307 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) -{ - return bsl::optional(bsl::allocator_arg, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) +{ + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 10 @@ -15241,36 +15175,36 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( // forwarding in some compilers. # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - bsl::allocator_arg_t, - typename bsl::optional::allocator_type const& alloc, - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + bsl::allocator_arg_t, + typename bsl::optional::allocator_type const& alloc, + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::allocator_arg, + return bsl::optional( + bsl::allocator_arg, alloc, bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # endif // }}} END GENERATED CODE #endif -template -BSLS_KEYWORD_CONSTEXPR bsl::optional::type> -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional::type> +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs) { - return bsl::optional::type>( - BSLS_COMPILERFEATURES_FORWARD(TYPE, rhs)); + return bsl::optional::type>( + BSLS_COMPILERFEATURES_FORWARD(t_TYPE, rhs)); } -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional() +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional() { - return bsl::optional(bsl::in_place); + return bsl::optional(bsl::in_place); } #if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES @@ -15283,536 +15217,557 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional() #define BSLSTL_OPTIONAL_VARIADIC_LIMIT_W BSLSTL_OPTIONAL_VARIADIC_LIMIT #endif #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg) +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg) { - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg)); + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10 -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) -{ - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) +{ + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10 # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il) { - return bsl::optional(bsl::in_place, + return bsl::optional( + bsl::in_place, il); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01) { - return bsl::optional(bsl::in_place, + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9 #if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10 -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_01) args_01, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_02) args_02, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_03) args_03, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_04) args_04, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_05) args_05, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_06) args_06, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_07) args_07, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_08) args_08, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_09) args_09, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS_10) args_10) -{ - return bsl::optional(bsl::in_place, +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_01) args_01, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_02) args_02, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_03) args_03, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_04) args_04, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_05) args_05, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_06) args_06, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_07) args_07, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_08) args_08, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_09) args_09, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS_10) args_10) +{ + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS_01, args_01), - BSLS_COMPILERFEATURES_FORWARD(ARGS_02, args_02), - BSLS_COMPILERFEATURES_FORWARD(ARGS_03, args_03), - BSLS_COMPILERFEATURES_FORWARD(ARGS_04, args_04), - BSLS_COMPILERFEATURES_FORWARD(ARGS_05, args_05), - BSLS_COMPILERFEATURES_FORWARD(ARGS_06, args_06), - BSLS_COMPILERFEATURES_FORWARD(ARGS_07, args_07), - BSLS_COMPILERFEATURES_FORWARD(ARGS_08, args_08), - BSLS_COMPILERFEATURES_FORWARD(ARGS_09, args_09), - BSLS_COMPILERFEATURES_FORWARD(ARGS_10, args_10)); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_01, args_01), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_02, args_02), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_03, args_03), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_04, args_04), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_05, args_05), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_06, args_06), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_07, args_07), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_08, args_08), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_09, args_09), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS_10, args_10)); } #endif // BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10 @@ -15820,27 +15775,28 @@ BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( #else // The generated code below is a workaround for the absence of perfect // forwarding in some compilers. -template -BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) -make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(ARG) arg, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(t_ARG) +make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::in_place, - BSLS_COMPILERFEATURES_FORWARD(ARG, arg), - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + return bsl::optional( + bsl::in_place, + BSLS_COMPILERFEATURES_FORWARD(t_ARG, arg), + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \ !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900) - -template -BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( - std::initializer_list il, - BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)... args) +template +BSLS_KEYWORD_CONSTEXPR bsl::optional make_optional( + std::initializer_list il, + BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args) { - return bsl::optional(bsl::in_place, + return bsl::optional( + bsl::in_place, il, - BSLS_COMPILERFEATURES_FORWARD(ARGS, args)...); + BSLS_COMPILERFEATURES_FORWARD(t_ARGS, args)...); } # endif // }}} END GENERATED CODE @@ -15919,6 +15875,7 @@ inline constexpr bool _Is_specialization_v, std::optional> = #undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED #undef BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG #undef BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG +#undef BSLSTL_OPTIONAL_REQUIRES #else // if ! defined(DEFINED_BSLSTL_OPTIONAL_H) # error Not valid except when included from bslstl_optional.h