11#ifndef INCLUDED_BSLSTL_OPTIONAL_CPP03
12#define INCLUDED_BSLSTL_OPTIONAL_CPP03
63#ifdef COMPILING_BSLSTL_OPTIONAL_H
69# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
76#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT) \
77 std::is_constructible<U, V>::value
82#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT) \
83 std::is_assignable<U, V>::value
87#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT) DEFAULT
89#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT) DEFAULT
96#define BSLSTL_OPTIONAL_CONVERTS_FROM(TYPE, OPT_TYPE) \
97 (bsl::is_convertible<const OPT_TYPE&, TYPE>::value || \
98 bsl::is_convertible<OPT_TYPE&, TYPE>::value || \
99 bsl::is_convertible<const OPT_TYPE, TYPE>::value || \
100 bsl::is_convertible<OPT_TYPE, TYPE>::value || \
101 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, const OPT_TYPE&, false) || \
102 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, OPT_TYPE&, false) || \
103 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, const OPT_TYPE, false) || \
104 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, OPT_TYPE, false))
109# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
110#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE) \
111 (std::is_assignable<TYPE&, const OPT_TYPE&>::value || \
112 std::is_assignable<TYPE&, OPT_TYPE&>::value || \
113 std::is_assignable<TYPE&, const OPT_TYPE>::value || \
114 std::is_assignable<TYPE&, OPT_TYPE>::value)
119#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE) false
122#define BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
123 BSLSTL_OPTIONAL_CONVERTS_FROM( \
125 bsl::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
127#define BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
128 BSLSTL_OPTIONAL_ASSIGNS_FROM( \
130 bsl::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
132# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
133#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
134 BSLSTL_OPTIONAL_CONVERTS_FROM( \
136 std::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
138#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
139 BSLSTL_OPTIONAL_ASSIGNS_FROM( \
141 std::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
145#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) false
146#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) false
152#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, \
154 typename bsl::enable_if< \
155 !bsl::is_same<TYPE, ANY_TYPE>::value && \
156 !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) && \
157 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true), \
158 BloombergLP::bslstl::Optional_OptNoSuchType>::type
160#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, \
162 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL( \
164 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
166#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, \
168 typename bsl::enable_if< \
169 !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) && \
170 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true), \
171 BloombergLP::bslstl::Optional_OptNoSuchType>::type
173#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, \
175 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL( \
177 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
179#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, \
181 typename bsl::enable_if< \
182 BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE, \
184 BloombergLP::bslstl::Optional_OptNoSuchType>::type
186#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, \
188 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR( \
190 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
192#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
194 typename bsl::enable_if< \
195 !BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE, \
197 BloombergLP::bslstl::Optional_OptNoSuchType>::type
199#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
201 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
203 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
205#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE) \
206 typename bsl::enable_if< \
207 BloombergLP::bslstl::Optional_ConstructsFromType<TYPE, \
209 BloombergLP::bslstl::Optional_OptNoSuchType>::type
211#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE) \
212 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM( \
214 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
216#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED) \
217 typename bsl::enable_if< \
218 BloombergLP::bslmf::IsAccessibleBaseOf<optional, DERIVED>::value && \
219 !bsl::is_const<DERIVED>::value, \
220 BloombergLP::bslstl::Optional_OptNoSuchType>::type
222#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(DERIVED) \
223 BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED) = \
224 BloombergLP::bslstl::Optional_OptNoSuchType(0)
226#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT(U, V) \
227 typename bsl::enable_if< \
228 !bsl::is_convertible<V, U>::value, \
229 BloombergLP::bslstl::Optional_OptNoSuchType>::type
231#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(U, V) \
232 BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT( \
234 V) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
236#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT(U, V) \
237 typename bsl::enable_if< \
238 bsl::is_convertible<V, U>::value, \
239 BloombergLP::bslstl::Optional_OptNoSuchType>::type
241#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(U, V) \
242 BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT( \
244 V) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
246#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
247 typename bsl::enable_if< \
248 !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) && \
249 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) && \
250 BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) && \
251 !BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE), \
252 optional<TYPE> >::type
254#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
255 typename bsl::enable_if< \
256 !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) && \
257 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) && \
258 BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) && \
259 !BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE), \
260 optional<TYPE> >::type
262# if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
263# define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(TYPE, DERIVED) \
264 typename bsl::enable_if< \
265 BloombergLP::bslmf::IsAccessibleBaseOf<bsl::optional<TYPE>, \
267 !bsl::is_same<bsl::optional<TYPE>, DERIVED>::value, \
268 optional<TYPE> >::type
271#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE) \
272 typename bsl::enable_if< \
273 !bsl::is_same<bsl::optional<TYPE>, \
274 typename bsl::remove_cvref<ANY_TYPE>::type>::value && \
275 !(bsl::is_same<TYPE, \
276 typename bsl::decay<ANY_TYPE>::type>::value && \
277 std::is_scalar<TYPE>::value) && \
278 std::is_constructible<TYPE, ANY_TYPE>::value && \
279 std::is_assignable<TYPE, ANY_TYPE>::value, \
280 optional<TYPE> >::type
282#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(TYPE, ANY_TYPE) \
283 typename bsl::enable_if< \
284 !::BloombergLP::bslmf::IsAccessibleBaseOf< \
285 bsl::optional<TYPE>, \
286 typename bsl::remove_cv< \
287 typename ::BloombergLP::bslmf::MovableRefUtil:: \
288 RemoveReference<ANY_TYPE>::type>::type>::value, \
289 optional<TYPE> >::type
291#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) \
292 typename bsl::enable_if< \
294 typename bsl::remove_cvref<ARG>::type, \
295 bsl::allocator_arg_t>::value, \
296 optional<t_TYPE> >::type
298#ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULT_TEMPLATE_ARGS
299 #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) = ARG
301 #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG)
304#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
305 #define BSLSTL_OPTIONAL_REQUIRES(EXPR) requires(EXPR)
307 #define BSLSTL_OPTIONAL_REQUIRES(EXPR)
314struct Optional_NulloptConstructToken {
321# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
323using nullopt_t = std::nullopt_t;
339 template <
class t_TYPE>
342 typename enable_if<is_same<t_TYPE,
343 BloombergLP::bslstl::
344 Optional_NulloptConstructToken>::value,
351# if defined(BSLS_COMPILERFEATURES_SUPPORT_INLINE_VARIABLES)
353nullopt_t
nullopt(BloombergLP::bslstl::Optional_NulloptConstructToken{});
362template <
class t_TYPE>
378# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
384template <
class t_TYPE>
385struct Optional_IsTriviallyDestructible
386: std::is_trivially_destructible<t_TYPE> {
391template <
class t_TYPE>
416struct Optional_OptNoSuchType {
443template <
class t_TYPE,
class t_ANY_TYPE>
444struct Optional_PropagatesAllocator
447 bslma::UsesBslmaAllocator<t_TYPE>::value &&
448 bsl::is_const<t_TYPE>::value &&
449 bsl::is_same<t_ANY_TYPE,
450 typename bsl::remove_cv<t_TYPE>::type>::value> {
456template <
class t_TYPE,
class t_ANY_TYPE>
457struct Optional_ConstructsFromType
460 !bslmf::IsAccessibleBaseOf<
461 bsl::optional<t_TYPE>,
462 typename bsl::remove_cvref<t_ANY_TYPE>::type>::value &&
463 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
464 bsl::nullopt_t>::value &&
465 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
466 bsl::in_place_t>::value &&
467 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
468 bsl::allocator_arg_t>::value &&
469 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(t_TYPE, t_ANY_TYPE, true)> {
480struct Optional_ConstructFromForwardRef {};
481struct Optional_CopyConstructFromOtherOptional {};
482struct Optional_MoveConstructFromOtherOptional {};
483struct Optional_CopyConstructFromStdOptional {};
484struct Optional_MoveConstructFromStdOptional {};
499template <
class t_TYPE>
500struct Optional_DataImp {
521#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
524#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
525#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
527#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_A
528#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_A BSLSTL_OPTIONAL_VARIADIC_LIMIT
530#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0
534#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1
535 template <
class t_ARGS_01>
540#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2
541 template <
class t_ARGS_01,
548#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3
549 template <
class t_ARGS_01,
558#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4
559 template <
class t_ARGS_01,
570#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5
571 template <
class t_ARGS_01,
584#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6
585 template <
class t_ARGS_01,
600#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7
601 template <
class t_ARGS_01,
618#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8
619 template <
class t_ARGS_01,
638#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9
639 template <
class t_ARGS_01,
660#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10
661 template <
class t_ARGS_01,
685# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
686#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 0
687 template <
class t_INIT_LIST_TYPE>
690 std::initializer_list<t_INIT_LIST_TYPE> initializer_list);
693#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 1
694 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
697 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
701#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 2
702 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
706 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
711#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 3
712 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
717 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
723#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 4
724 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
730 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
737#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 5
738 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
745 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
753#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 6
754 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
762 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
771#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 7
772 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
781 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
791#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 8
792 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
802 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
813#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 9
814 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
825 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
837#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_A >= 10
838 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
850 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
867 template <
class... t_ARGS>
871# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
872 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
875 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
884# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
902# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
906 const t_TYPE&
value() const &;
907 const t_TYPE&&
value() const &&;
910 const t_TYPE&
value()
const;
927 bool t_IS_TRIVIALLY_DESTRUCTIBLE =
929struct Optional_Data :
public Optional_DataImp<t_TYPE> {
945template <
class t_TYPE>
946struct Optional_Data<t_TYPE, true> :
public Optional_DataImp<t_TYPE> {
958#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
959template <
class t_TYPE>
962template <
class t_TYPE>
963void optional_acceptsStdOptional(
const std::optional<t_TYPE>&);
965template <
class t_TYPE>
966concept Optional_ConvertibleToBool =
969 bsl::is_convertible_v<t_TYPE, bool>;
971template <
class t_TYPE>
972concept Optional_DerivedFromBslOptional =
975 requires (
const t_TYPE& t) { optional_acceptsBslOptional(t); };
977template <
class t_TYPE>
978concept Optional_DerivedFromStdOptional =
981 requires (
const t_TYPE& t) { optional_acceptsStdOptional(t); };
983template <
class t_TYPE>
984concept Optional_DerivedFromOptional =
987 Optional_DerivedFromBslOptional<t_TYPE> ||
988 Optional_DerivedFromStdOptional<t_TYPE>;
1005template <
class t_TYPE,
1006 bool t_USES_BSLMA_ALLOC =
1007 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
1008class Optional_Base {
1027 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1029# ifndef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
1036 typedef BloombergLP::bsls::UnspecifiedBool<Optional_Base>
1037 UnspecifiedBoolUtil;
1038 typedef typename UnspecifiedBoolUtil::BoolType UnspecifiedBool;
1044 BloombergLP::bslstl::Optional_Data<t_TYPE> d_value;
1065 Optional_Base(BloombergLP::bslmf::MovableRef<Optional_Base> original)
1077 template <
class t_ANY_TYPE>
1078 Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef,
1085 template <
class t_ANY_TYPE>
1086 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1087 const Optional_Base<t_ANY_TYPE>& original);
1094 template <
class t_ANY_TYPE>
1096 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1108 template <
class t_ANY_TYPE>
1110 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1115# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1120 template <
class t_ANY_TYPE>
1121 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
1122 const std::optional<t_ANY_TYPE>& original);
1128 template <
class t_ANY_TYPE>
1129 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
1130 std::optional<t_ANY_TYPE>&& original);
1133#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1136#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
1137#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
1139#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_B
1140#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_B BSLSTL_OPTIONAL_VARIADIC_LIMIT
1142#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 0
1146#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 1
1147 template <
class t_ARGS_01>
1152#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 2
1153 template <
class t_ARGS_01,
1160#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 3
1161 template <
class t_ARGS_01,
1170#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 4
1171 template <
class t_ARGS_01,
1182#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 5
1183 template <
class t_ARGS_01,
1196#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 6
1197 template <
class t_ARGS_01,
1212#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 7
1213 template <
class t_ARGS_01,
1230#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 8
1231 template <
class t_ARGS_01,
1250#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 9
1251 template <
class t_ARGS_01,
1272#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 10
1273 template <
class t_ARGS_01,
1296# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1297#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 0
1298 template <
class t_INIT_LIST_TYPE>
1300 std::initializer_list<t_INIT_LIST_TYPE> il);
1303#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 1
1304 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
1306 std::initializer_list<t_INIT_LIST_TYPE> il,
1310#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 2
1311 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1314 std::initializer_list<t_INIT_LIST_TYPE> il,
1319#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 3
1320 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1324 std::initializer_list<t_INIT_LIST_TYPE> il,
1330#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 4
1331 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1336 std::initializer_list<t_INIT_LIST_TYPE> il,
1343#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 5
1344 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1350 std::initializer_list<t_INIT_LIST_TYPE> il,
1358#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 6
1359 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1366 std::initializer_list<t_INIT_LIST_TYPE> il,
1375#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 7
1376 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1384 std::initializer_list<t_INIT_LIST_TYPE> il,
1394#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 8
1395 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1404 std::initializer_list<t_INIT_LIST_TYPE> il,
1415#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 9
1416 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1426 std::initializer_list<t_INIT_LIST_TYPE> il,
1438#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_B >= 10
1439 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1450 std::initializer_list<t_INIT_LIST_TYPE> il,
1467 template <
class... t_ARGS>
1470# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1471 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1473 std::initializer_list<t_INIT_LIST_TYPE> il,
1506 BloombergLP::bslmf::MovableRef<Optional_Base> original);
1511 template <
class t_ANY_TYPE>
1514 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
1521 template <
class t_ANY_TYPE>
1524 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1525 const Optional_Base<t_ANY_TYPE>& original);
1533 template <
class t_ANY_TYPE>
1536 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1539# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1545 template <
class t_ANY_TYPE>
1548 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
1549 const std::optional<t_ANY_TYPE>& original);
1557 template <
class t_ANY_TYPE>
1560 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
1561 std::optional<t_ANY_TYPE>&& original);
1564#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
1567#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
1568#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
1570#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_C
1571#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_C BSLSTL_OPTIONAL_VARIADIC_LIMIT
1573#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 0
1579#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 1
1580 template <
class t_ARGS_01>
1587#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 2
1588 template <
class t_ARGS_01,
1597#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 3
1598 template <
class t_ARGS_01,
1609#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 4
1610 template <
class t_ARGS_01,
1623#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 5
1624 template <
class t_ARGS_01,
1639#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 6
1640 template <
class t_ARGS_01,
1657#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 7
1658 template <
class t_ARGS_01,
1677#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 8
1678 template <
class t_ARGS_01,
1699#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 9
1700 template <
class t_ARGS_01,
1723#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 10
1724 template <
class t_ARGS_01,
1750# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1751#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 0
1752 template <
class t_INIT_LIST_TYPE>
1756 std::initializer_list<t_INIT_LIST_TYPE> il);
1759#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 1
1760 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
1764 std::initializer_list<t_INIT_LIST_TYPE> il,
1768#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 2
1769 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1774 std::initializer_list<t_INIT_LIST_TYPE> il,
1779#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 3
1780 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1786 std::initializer_list<t_INIT_LIST_TYPE> il,
1792#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 4
1793 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1800 std::initializer_list<t_INIT_LIST_TYPE> il,
1807#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 5
1808 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1816 std::initializer_list<t_INIT_LIST_TYPE> il,
1824#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 6
1825 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1834 std::initializer_list<t_INIT_LIST_TYPE> il,
1843#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 7
1844 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1854 std::initializer_list<t_INIT_LIST_TYPE> il,
1864#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 8
1865 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1876 std::initializer_list<t_INIT_LIST_TYPE> il,
1887#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 9
1888 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1900 std::initializer_list<t_INIT_LIST_TYPE> il,
1912#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_C >= 10
1913 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
1926 std::initializer_list<t_INIT_LIST_TYPE> il,
1943 template <
class... t_ARGS>
1949# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1950 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1954 std::initializer_list<t_INIT_LIST_TYPE> il,
1966 template <
class t_ANY_TYPE>
1969# ifndef BDE_OMIT_INTERNAL_DEPRECATED
1994 BloombergLP::bslma::UsesBslmaAllocator);
1996 BloombergLP::bslmf::UsesAllocatorArgT);
1999 BloombergLP::bslmf::IsBitwiseMoveable,
2000 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
2003 BloombergLP::bslmf::IsBitwiseCopyable,
2004 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
2007#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2010#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
2011#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
2013#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_D
2014#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_D BSLSTL_OPTIONAL_VARIADIC_LIMIT
2016#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 0
2020#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 1
2021 template <
class t_ARGS_01>
2025#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 2
2026 template <
class t_ARGS_01,
2032#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 3
2033 template <
class t_ARGS_01,
2041#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 4
2042 template <
class t_ARGS_01,
2052#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 5
2053 template <
class t_ARGS_01,
2065#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 6
2066 template <
class t_ARGS_01,
2080#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 7
2081 template <
class t_ARGS_01,
2097#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 8
2098 template <
class t_ARGS_01,
2116#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 9
2117 template <
class t_ARGS_01,
2137#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 10
2138 template <
class t_ARGS_01,
2161# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2162#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 0
2163 template <
class t_INIT_LIST_TYPE>
2164 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il);
2167#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 1
2168 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
2169 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2173#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 2
2174 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2176 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2181#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 3
2182 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2185 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2191#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 4
2192 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2196 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2203#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 5
2204 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2209 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2217#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 6
2218 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2224 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2233#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 7
2234 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2241 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2251#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 8
2252 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2260 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2271#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 9
2272 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2281 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2293#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_D >= 10
2294 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2304 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2322 template <
class... t_ARGS>
2325# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2326 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
2327 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
2338 bsl::is_nothrow_move_constructible<t_TYPE>::
value &&
2339 bsl::is_nothrow_swappable<t_TYPE>::
value);
2348# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2353 t_TYPE&&
value() &&;
2361# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2366 template <
class t_ANY_TYPE>
2368# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
2374 template <
class t_ANY_TYPE>
2375 t_TYPE
value_or(bsl::allocator_arg_t,
2377 t_ANY_TYPE&&
value) &&;
2391 BloombergLP::bslmf::MovableRef<Optional_Base> rhs);
2398# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2420# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2424 const t_TYPE&
value() const &;
2425 const t_TYPE&&
value() const &&;
2428 const t_TYPE&
value()
const;
2440# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2446 const t_TYPE&& operator*() const &&;
2457# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
2462 template <
class t_ANY_TYPE>
2465# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
2471 template <
class t_ANY_TYPE>
2473 bsl::allocator_arg_t,
2478 template <
class t_ANY_TYPE>
2484# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
2485 template <
class t_ANY_TYPE>
2486 t_TYPE
value_or(bsl::allocator_arg_t,
2497#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
2505 return UnspecifiedBoolUtil::makeValue(
has_value());
2518# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2521template <
class t_TYPE>
2522class Optional_Base<t_TYPE, false> :
public std::optional<t_TYPE> {
2526 typedef std::optional<t_TYPE> StdOptionalBase;
2548 template <
class t_ANY_TYPE>
2549 Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef,
2550 t_ANY_TYPE&&
value);
2556 template <
class t_ANY_TYPE>
2557 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
2558 const Optional_Base<t_ANY_TYPE>& original);
2565 template <
class t_ANY_TYPE>
2566 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
2567 Optional_Base<t_ANY_TYPE>&& original);
2569 template <
class t_ANY_TYPE>
2570 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
2571 const std::optional<t_ANY_TYPE>& original);
2573 template <
class t_ANY_TYPE>
2574 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
2575 std::optional<t_ANY_TYPE>&& original);
2579 template <
class... t_ARGS>
2584 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
2586 std::initializer_list<t_INIT_LIST_TYPE> il,
2597 template <
class t_ANY_TYPE>
2600 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
2603 template <
class t_ANY_TYPE>
2606 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
2607 const Optional_Base<t_ANY_TYPE>&);
2609 template <
class t_ANY_TYPE>
2612 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
2613 Optional_Base<t_ANY_TYPE>&&);
2615 template <
class t_ANY_TYPE>
2618 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
2619 const std::optional<t_ANY_TYPE>&);
2621 template <
class t_ANY_TYPE>
2624 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
2625 std::optional<t_ANY_TYPE>&&);
2627 template <
class... t_ARGS>
2633 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
2637 std::initializer_list<t_INIT_LIST_TYPE>,
2645 template <
class t_ANY_TYPE>
2648# ifndef BDE_OMIT_INTERNAL_DEPRECATED
2674 BloombergLP::bslmf::IsBitwiseMoveable,
2675 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
2678 BloombergLP::bslmf::IsBitwiseCopyable,
2679 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
2691template <
class t_TYPE>
2692class Optional_Base<t_TYPE, false> {
2698 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
2700# ifndef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
2707 typedef BloombergLP::bsls::UnspecifiedBool<Optional_Base>
2708 UnspecifiedBoolUtil;
2709 typedef typename UnspecifiedBoolUtil::BoolType UnspecifiedBool;
2713 BloombergLP::bslstl::Optional_Data<t_TYPE> d_value;
2736 Optional_Base(BloombergLP::bslmf::MovableRef<Optional_Base> original)
2744 template <
class t_ANY_TYPE>
2745 Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef,
2750 template <
class t_ANY_TYPE>
2751 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
2752 const Optional_Base<t_ANY_TYPE>& original);
2757 template <
class t_ANY_TYPE>
2758 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
2765#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
2768#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
2769#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
2771#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_E
2772#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_E BSLSTL_OPTIONAL_VARIADIC_LIMIT
2774#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 0
2778#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 1
2779 template <
class t_ARGS_01>
2784#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 2
2785 template <
class t_ARGS_01,
2792#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 3
2793 template <
class t_ARGS_01,
2802#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 4
2803 template <
class t_ARGS_01,
2814#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 5
2815 template <
class t_ARGS_01,
2828#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 6
2829 template <
class t_ARGS_01,
2844#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 7
2845 template <
class t_ARGS_01,
2862#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 8
2863 template <
class t_ARGS_01,
2882#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 9
2883 template <
class t_ARGS_01,
2904#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 10
2905 template <
class t_ARGS_01,
2929# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2930#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 0
2931 template <
class t_INIT_LIST_TYPE>
2933 std::initializer_list<t_INIT_LIST_TYPE> il);
2936#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 1
2937 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
2939 std::initializer_list<t_INIT_LIST_TYPE> il,
2943#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 2
2944 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2947 std::initializer_list<t_INIT_LIST_TYPE> il,
2952#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 3
2953 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2957 std::initializer_list<t_INIT_LIST_TYPE> il,
2963#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 4
2964 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2969 std::initializer_list<t_INIT_LIST_TYPE> il,
2976#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 5
2977 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2983 std::initializer_list<t_INIT_LIST_TYPE> il,
2991#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 6
2992 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
2999 std::initializer_list<t_INIT_LIST_TYPE> il,
3008#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 7
3009 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3017 std::initializer_list<t_INIT_LIST_TYPE> il,
3027#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 8
3028 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3037 std::initializer_list<t_INIT_LIST_TYPE> il,
3048#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 9
3049 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3059 std::initializer_list<t_INIT_LIST_TYPE> il,
3071#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_E >= 10
3072 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3083 std::initializer_list<t_INIT_LIST_TYPE> il,
3100 template <
class... t_ARGS>
3104# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3105 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3107 std::initializer_list<t_INIT_LIST_TYPE> il,
3124 BloombergLP::bslmf::MovableRef<Optional_Base>);
3126 template <
class t_ANY_TYPE>
3129 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
3132 template <
class t_ANY_TYPE>
3135 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
3136 const Optional_Base<t_ANY_TYPE>&);
3138 template <
class t_ANY_TYPE>
3141 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3144#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3147#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
3148#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
3150#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_F
3151#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_F BSLSTL_OPTIONAL_VARIADIC_LIMIT
3153#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 0
3159#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 1
3160 template <
class t_ARGS_01>
3167#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 2
3168 template <
class t_ARGS_01,
3177#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 3
3178 template <
class t_ARGS_01,
3189#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 4
3190 template <
class t_ARGS_01,
3203#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 5
3204 template <
class t_ARGS_01,
3219#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 6
3220 template <
class t_ARGS_01,
3237#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 7
3238 template <
class t_ARGS_01,
3257#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 8
3258 template <
class t_ARGS_01,
3279#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 9
3280 template <
class t_ARGS_01,
3303#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 10
3304 template <
class t_ARGS_01,
3330# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3331#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 0
3332 template <
class t_INIT_LIST_TYPE>
3336 std::initializer_list<t_INIT_LIST_TYPE>);
3339#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 1
3340 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
3344 std::initializer_list<t_INIT_LIST_TYPE>,
3348#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 2
3349 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3354 std::initializer_list<t_INIT_LIST_TYPE>,
3359#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 3
3360 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3366 std::initializer_list<t_INIT_LIST_TYPE>,
3372#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 4
3373 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3380 std::initializer_list<t_INIT_LIST_TYPE>,
3387#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 5
3388 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3396 std::initializer_list<t_INIT_LIST_TYPE>,
3404#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 6
3405 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3414 std::initializer_list<t_INIT_LIST_TYPE>,
3423#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 7
3424 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3434 std::initializer_list<t_INIT_LIST_TYPE>,
3444#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 8
3445 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3456 std::initializer_list<t_INIT_LIST_TYPE>,
3467#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 9
3468 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3480 std::initializer_list<t_INIT_LIST_TYPE>,
3492#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_F >= 10
3493 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3506 std::initializer_list<t_INIT_LIST_TYPE>,
3523 template <
class... t_ARGS>
3529# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3530 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3534 std::initializer_list<t_INIT_LIST_TYPE>,
3541 template <
class t_ANY_TYPE>
3547# ifndef BDE_OMIT_INTERNAL_DEPRECATED
3579 BloombergLP::bslmf::IsBitwiseMoveable,
3580 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
3583 BloombergLP::bslmf::IsBitwiseCopyable,
3584 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
3587#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
3590#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
3591#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
3593#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_G
3594#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_G BSLSTL_OPTIONAL_VARIADIC_LIMIT
3596#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 0
3600#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 1
3601 template <
class t_ARGS_01>
3605#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 2
3606 template <
class t_ARGS_01,
3612#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 3
3613 template <
class t_ARGS_01,
3621#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 4
3622 template <
class t_ARGS_01,
3632#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 5
3633 template <
class t_ARGS_01,
3645#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 6
3646 template <
class t_ARGS_01,
3660#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 7
3661 template <
class t_ARGS_01,
3677#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 8
3678 template <
class t_ARGS_01,
3696#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 9
3697 template <
class t_ARGS_01,
3717#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 10
3718 template <
class t_ARGS_01,
3741# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3742#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 0
3743 template <
class t_INIT_LIST_TYPE>
3744 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il);
3747#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 1
3748 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
3749 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3753#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 2
3754 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3756 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3761#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 3
3762 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3765 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3771#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 4
3772 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3776 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3783#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 5
3784 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3789 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3797#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 6
3798 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3804 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3813#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 7
3814 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3821 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3831#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 8
3832 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3840 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3851#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 9
3852 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3861 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3873#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_G >= 10
3874 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
3884 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3902 template <
class... t_ARGS>
3905# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3906 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3907 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
3919 bsl::is_nothrow_move_constructible<t_TYPE>::
value &&
3920 bsl::is_nothrow_swappable<t_TYPE>::
value);
3927# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3929 t_TYPE&&
value() &&;
3942# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3943 template <
class t_ANY_TYPE>
3956 BloombergLP::bslmf::MovableRef<Optional_Base> rhs);
3968# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3989# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3990 const t_TYPE&
value() const &;
3991 const t_TYPE&&
value() const &&;
3996 const t_TYPE&
value()
const;
4003# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4004 template <
class t_ANY_TYPE>
4012 template <
class t_ANY_TYPE>
4025# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4027 const t_TYPE&& operator*() const&&;
4038#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
4046 return UnspecifiedBoolUtil::makeValue(
has_value());
4065template <
class t_TYPE>
4066class optional :
public BloombergLP::bslstl::Optional_Base<t_TYPE> {
4069 typedef BloombergLP::bslstl::Optional_Base<t_TYPE> BaseType;
4071 typedef typename BaseType::AllocType AllocType;
4073 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
4079 BloombergLP::bslma::UsesBslmaAllocator,
4080 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value);
4083 BloombergLP::bslmf::UsesAllocatorArgT,
4084 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value);
4087 BloombergLP::bslmf::IsBitwiseMoveable,
4088 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
4091 BloombergLP::bslmf::IsBitwiseCopyable,
4092 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
4104#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
4105 template <
class t_DERIVED>
4106 optional(BloombergLP::bslmf::MovableRef<t_DERIVED> original,
4123 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
4136 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
4142 template <
class t_ANY_TYPE>
4144 const optional<t_ANY_TYPE>& original,
4149 const t_ANY_TYPE&));
4160 template <
class t_ANY_TYPE>
4162 const optional<t_ANY_TYPE>& original,
4167 const t_ANY_TYPE&));
4169 template <
class t_ANY_TYPE>
4187 template <
class t_ANY_TYPE>
4194# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
4195 template <
class t_ANY_TYPE>
4197 const std::optional<t_ANY_TYPE>& original,
4213 template <
class t_ANY_TYPE>
4215 const std::optional<t_ANY_TYPE>& original,
4221 template <
class t_ANY_TYPE>
4223 std::optional<t_ANY_TYPE>&& original,
4237 template <
class t_ANY_TYPE>
4239 std::optional<t_ANY_TYPE>&& original,
4245#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
4248#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
4249#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
4251#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_H
4252#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_H BSLSTL_OPTIONAL_VARIADIC_LIMIT
4254#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 0
4258#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 1
4259 template <
class t_ARGS_01>
4264#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 2
4265 template <
class t_ARGS_01,
4272#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 3
4273 template <
class t_ARGS_01,
4282#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 4
4283 template <
class t_ARGS_01,
4294#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 5
4295 template <
class t_ARGS_01,
4308#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 6
4309 template <
class t_ARGS_01,
4324#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 7
4325 template <
class t_ARGS_01,
4342#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 8
4343 template <
class t_ARGS_01,
4362#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 9
4363 template <
class t_ARGS_01,
4384#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 10
4385 template <
class t_ARGS_01,
4409# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4410#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 0
4411 template <
class t_INIT_LIST_TYPE>
4413 std::initializer_list<t_INIT_LIST_TYPE> il);
4416#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 1
4417 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
4419 std::initializer_list<t_INIT_LIST_TYPE> il,
4423#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 2
4424 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4427 std::initializer_list<t_INIT_LIST_TYPE> il,
4432#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 3
4433 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4437 std::initializer_list<t_INIT_LIST_TYPE> il,
4443#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 4
4444 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4449 std::initializer_list<t_INIT_LIST_TYPE> il,
4456#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 5
4457 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4463 std::initializer_list<t_INIT_LIST_TYPE> il,
4471#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 6
4472 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4479 std::initializer_list<t_INIT_LIST_TYPE> il,
4488#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 7
4489 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4497 std::initializer_list<t_INIT_LIST_TYPE> il,
4507#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 8
4508 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4517 std::initializer_list<t_INIT_LIST_TYPE> il,
4528#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 9
4529 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4539 std::initializer_list<t_INIT_LIST_TYPE> il,
4551#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_H >= 10
4552 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4563 std::initializer_list<t_INIT_LIST_TYPE> il,
4580 template <
class... t_ARGS>
4584# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4585 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4587 std::initializer_list<t_INIT_LIST_TYPE> il,
4598 optional(bsl::allocator_arg_t, AllocType allocator);
4609 AllocType allocator,
4621 template <
class t_DERIVED>
4623 AllocType allocator,
4626 typename bsl::remove_reference<t_DERIVED>::type));
4634 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
4636 AllocType allocator,
4641 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
4643 bsl::allocator_arg_t,
4644 AllocType allocator,
4657 template <
class t_ANY_TYPE>
4659 bsl::allocator_arg_t,
4660 AllocType allocator,
4661 const optional<t_ANY_TYPE>& original,
4666 const t_ANY_TYPE&));
4667 template <
class t_ANY_TYPE>
4669 bsl::allocator_arg_t,
4670 AllocType allocator,
4671 const optional<t_ANY_TYPE>& original,
4676 const t_ANY_TYPE&));
4687 template <
class t_ANY_TYPE>
4689 bsl::allocator_arg_t,
4690 AllocType allocator,
4695 template <
class t_ANY_TYPE>
4697 bsl::allocator_arg_t,
4698 AllocType allocator,
4704# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
4713 template <
class t_ANY_TYPE>
4715 bsl::allocator_arg_t,
4716 AllocType allocator,
4717 const std::optional<t_ANY_TYPE>& original,
4722 const t_ANY_TYPE&));
4723 template <
class t_ANY_TYPE>
4725 bsl::allocator_arg_t,
4726 AllocType allocator,
4727 const std::optional<t_ANY_TYPE>& original,
4743 template <
class t_ANY_TYPE>
4745 bsl::allocator_arg_t,
4746 AllocType allocator,
4747 std::optional<t_ANY_TYPE>&& original,
4751 template <
class t_ANY_TYPE>
4753 bsl::allocator_arg_t,
4754 AllocType allocator,
4755 std::optional<t_ANY_TYPE>&& original,
4761#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
4764#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
4765#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
4767#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_I
4768#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_I BSLSTL_OPTIONAL_VARIADIC_LIMIT
4770#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 0
4771 explicit optional(bsl::allocator_arg_t,
4772 AllocType allocator,
4776#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 1
4777 template <
class t_ARGS_01>
4778 explicit optional(bsl::allocator_arg_t,
4779 AllocType allocator,
4784#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 2
4785 template <
class t_ARGS_01,
4787 explicit optional(bsl::allocator_arg_t,
4788 AllocType allocator,
4794#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 3
4795 template <
class t_ARGS_01,
4798 explicit optional(bsl::allocator_arg_t,
4799 AllocType allocator,
4806#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 4
4807 template <
class t_ARGS_01,
4811 explicit optional(bsl::allocator_arg_t,
4812 AllocType allocator,
4820#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 5
4821 template <
class t_ARGS_01,
4826 explicit optional(bsl::allocator_arg_t,
4827 AllocType allocator,
4836#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 6
4837 template <
class t_ARGS_01,
4843 explicit optional(bsl::allocator_arg_t,
4844 AllocType allocator,
4854#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 7
4855 template <
class t_ARGS_01,
4862 explicit optional(bsl::allocator_arg_t,
4863 AllocType allocator,
4874#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 8
4875 template <
class t_ARGS_01,
4883 explicit optional(bsl::allocator_arg_t,
4884 AllocType allocator,
4896#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 9
4897 template <
class t_ARGS_01,
4906 explicit optional(bsl::allocator_arg_t,
4907 AllocType allocator,
4920#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 10
4921 template <
class t_ARGS_01,
4931 explicit optional(bsl::allocator_arg_t,
4932 AllocType allocator,
4947# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4948#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 0
4949 template <
class t_INIT_LIST_TYPE>
4950 explicit optional(bsl::allocator_arg_t,
4951 AllocType allocator,
4953 std::initializer_list<t_INIT_LIST_TYPE> il);
4956#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 1
4957 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
4958 explicit optional(bsl::allocator_arg_t,
4959 AllocType allocator,
4961 std::initializer_list<t_INIT_LIST_TYPE> il,
4965#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 2
4966 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4968 explicit optional(bsl::allocator_arg_t,
4969 AllocType allocator,
4971 std::initializer_list<t_INIT_LIST_TYPE> il,
4976#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 3
4977 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4980 explicit optional(bsl::allocator_arg_t,
4981 AllocType allocator,
4983 std::initializer_list<t_INIT_LIST_TYPE> il,
4989#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 4
4990 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
4994 explicit optional(bsl::allocator_arg_t,
4995 AllocType allocator,
4997 std::initializer_list<t_INIT_LIST_TYPE> il,
5004#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 5
5005 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5010 explicit optional(bsl::allocator_arg_t,
5011 AllocType allocator,
5013 std::initializer_list<t_INIT_LIST_TYPE> il,
5021#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 6
5022 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5028 explicit optional(bsl::allocator_arg_t,
5029 AllocType allocator,
5031 std::initializer_list<t_INIT_LIST_TYPE> il,
5040#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 7
5041 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5048 explicit optional(bsl::allocator_arg_t,
5049 AllocType allocator,
5051 std::initializer_list<t_INIT_LIST_TYPE> il,
5061#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 8
5062 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5070 explicit optional(bsl::allocator_arg_t,
5071 AllocType allocator,
5073 std::initializer_list<t_INIT_LIST_TYPE> il,
5084#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 9
5085 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5094 explicit optional(bsl::allocator_arg_t,
5095 AllocType allocator,
5097 std::initializer_list<t_INIT_LIST_TYPE> il,
5109#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_I >= 10
5110 template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
5120 explicit optional(bsl::allocator_arg_t,
5121 AllocType allocator,
5123 std::initializer_list<t_INIT_LIST_TYPE> il,
5140 template <
class... t_ARGS>
5141 explicit optional(bsl::allocator_arg_t,
5142 AllocType allocator,
5146# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5147 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
5148 explicit optional(bsl::allocator_arg_t,
5149 AllocType allocator,
5151 std::initializer_list<t_INIT_LIST_TYPE> il,
5167#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5168 template <
class t_DERIVED>
5170 operator=(BloombergLP::bslmf::MovableRef<t_DERIVED> rhs);
5188 template <
class t_ANY_TYPE>
5190 operator=(
const optional<t_ANY_TYPE>& rhs);
5198 template <
class t_ANY_TYPE>
5202#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5213 template <
class t_ANY_TYPE = t_TYPE>
5231 template <
class t_ANY_TYPE>
5240 template <
class t_ANY_TYPE>
5242 operator=(BloombergLP::bslmf::MovableRef<t_ANY_TYPE> rhs);
5245#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5252 template <
class t_ANY_TYPE = t_TYPE>
5254 operator=(
const std::optional<t_ANY_TYPE>& rhs);
5262 template <
class t_ANY_TYPE = t_TYPE>
5264 operator=(std::optional<t_ANY_TYPE>&& rhs);
5277template <
class t_TYPE>
5278struct UsesBslmaAllocator<
bslstl::Optional_Base<t_TYPE, false> >
5282template <
class t_TYPE>
5283struct UsesBslmaAllocator<
bsl::optional<t_TYPE> >
5284: UsesBslmaAllocator<t_TYPE> {
5296# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
5301template <
class t_TYPE>
5302optional(t_TYPE) -> optional<t_TYPE>;
5309template <
class t_TYPE,
5311 class =
typename bsl::enable_if_t<
5312 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>,
5313 class =
typename bsl::enable_if_t<
5314 bsl::is_convertible_v<t_ALLOC, bsl::allocator<char>>>
5316optional(bsl::allocator_arg_t, t_ALLOC, t_TYPE)
5324template <
class t_TYPE,
5326 class =
typename bsl::enable_if_t<
5327 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>,
5328 class =
typename bsl::enable_if_t<
5329 bsl::is_convertible_v<t_ALLOC, bsl::allocator<char>>>
5331optional(bsl::allocator_arg_t, t_ALLOC, optional<t_TYPE>)
5345template <
class t_TYPE>
5354template <
class t_TYPE>
5363template <
class t_HASHALG,
class t_TYPE>
5364void hashAppend(t_HASHALG& hashAlg,
const optional<t_TYPE>& input);
5367template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5371 { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5378template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5382 { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5390template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5394 { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5401template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5405 { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5412template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5416 { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5422template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5426 { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5434template <
class t_TYPE>
5438#if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \
5439 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS))
5440template <
class t_TYPE>
5448template <
class t_TYPE>
5452template <
class t_TYPE>
5460template <
class t_TYPE>
5467template <
class t_TYPE>
5475template <
class t_TYPE>
5482template <
class t_TYPE>
5489template <
class t_TYPE>
5496template <
class t_TYPE>
5503template <
class t_TYPE>
5510template <
class t_TYPE>
5521template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5523 const t_RHS_TYPE& rhs)
5525 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5527 { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5529template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5533 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5535 { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5542template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5544 const t_RHS_TYPE& rhs)
5546 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5548 { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5550template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5554 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5556 { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5564template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5567 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5569 { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5575template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5578 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5580 { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5586template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5589 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5591 { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5597template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5600 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5602 { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5608template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5611 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5613 { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5619template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5622 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5624 { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5630template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5633 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5635 { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5641template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5644 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5646 { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5652#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
5653 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
5657template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
5658constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5665template <
class t_LHS,
class t_RHS>
5666requires (!BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS>) &&
5667 three_way_comparable_with<t_LHS, t_RHS>
5668constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5674template <
class t_TYPE>
5675constexpr strong_ordering operator<=>(
5682template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
5683constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5685 const std::optional<t_RHS>& rhs);
5688# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5693template <
class t_TYPE>
5697template <
class t_TYPE>
5709template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5710bool operator==(
const std::optional<t_LHS_TYPE>& lhs,
5712template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5714 const std::optional<t_RHS_TYPE>& rhs);
5722template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5724 const std::optional<t_RHS_TYPE>& rhs);
5725template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5726bool operator!=(
const std::optional<t_LHS_TYPE>& lhs,
5735template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5737 const std::optional<t_RHS_TYPE>& rhs);
5738template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5739bool operator<(
const std::optional<t_LHS_TYPE>& lhs,
5748template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5750 const std::optional<t_RHS_TYPE>& rhs);
5751template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5752bool operator>(
const std::optional<t_LHS_TYPE>& lhs,
5760template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5762 const std::optional<t_RHS_TYPE>& rhs);
5763template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5764bool operator<=(
const std::optional<t_LHS_TYPE>& lhs,
5772template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5774 const std::optional<t_RHS_TYPE>& rhs);
5775template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5776bool operator>=(
const std::optional<t_LHS_TYPE>& lhs,
5785template <
class t_TYPE>
5792#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
5795#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
5796#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
5798#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_J
5799#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_J BSLSTL_OPTIONAL_VARIADIC_LIMIT
5801#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0
5802template <
class t_TYPE>
5804 bsl::allocator_arg_t,
5808#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1
5809template <
class t_TYPE,
class t_ARGS_01>
5811 bsl::allocator_arg_t,
5816#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2
5817template <
class t_TYPE,
class t_ARGS_01,
5820 bsl::allocator_arg_t,
5826#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3
5827template <
class t_TYPE,
class t_ARGS_01,
5831 bsl::allocator_arg_t,
5838#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4
5839template <
class t_TYPE,
class t_ARGS_01,
5844 bsl::allocator_arg_t,
5852#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5
5853template <
class t_TYPE,
class t_ARGS_01,
5859 bsl::allocator_arg_t,
5868#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6
5869template <
class t_TYPE,
class t_ARGS_01,
5876 bsl::allocator_arg_t,
5886#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7
5887template <
class t_TYPE,
class t_ARGS_01,
5895 bsl::allocator_arg_t,
5906#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8
5907template <
class t_TYPE,
class t_ARGS_01,
5916 bsl::allocator_arg_t,
5928#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9
5929template <
class t_TYPE,
class t_ARGS_01,
5939 bsl::allocator_arg_t,
5952#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10
5953template <
class t_TYPE,
class t_ARGS_01,
5964 bsl::allocator_arg_t,
5979# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
5980 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
5982#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 0
5983template <
class t_TYPE,
class t_INIT_LIST_TYPE>
5985 bsl::allocator_arg_t,
5987 std::initializer_list<t_INIT_LIST_TYPE> il);
5990#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 1
5991template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01>
5993 bsl::allocator_arg_t,
5995 std::initializer_list<t_INIT_LIST_TYPE> il,
5999#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 2
6000template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6003 bsl::allocator_arg_t,
6005 std::initializer_list<t_INIT_LIST_TYPE> il,
6010#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 3
6011template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6015 bsl::allocator_arg_t,
6017 std::initializer_list<t_INIT_LIST_TYPE> il,
6023#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 4
6024template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6029 bsl::allocator_arg_t,
6031 std::initializer_list<t_INIT_LIST_TYPE> il,
6038#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 5
6039template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6045 bsl::allocator_arg_t,
6047 std::initializer_list<t_INIT_LIST_TYPE> il,
6055#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 6
6056template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6063 bsl::allocator_arg_t,
6065 std::initializer_list<t_INIT_LIST_TYPE> il,
6074#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 7
6075template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6083 bsl::allocator_arg_t,
6085 std::initializer_list<t_INIT_LIST_TYPE> il,
6095#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 8
6096template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6105 bsl::allocator_arg_t,
6107 std::initializer_list<t_INIT_LIST_TYPE> il,
6118#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 9
6119template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6129 bsl::allocator_arg_t,
6131 std::initializer_list<t_INIT_LIST_TYPE> il,
6143#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_J >= 10
6144template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6155 bsl::allocator_arg_t,
6157 std::initializer_list<t_INIT_LIST_TYPE> il,
6174template <
class t_TYPE,
class... t_ARGS>
6176 bsl::allocator_arg_t,
6180# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
6181 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
6183template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
6185 bsl::allocator_arg_t,
6187 std::initializer_list<t_INIT_LIST_TYPE> il,
6197template <
class t_TYPE>
6204template <
class t_TYPE>
6207#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6210#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
6211#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
6213#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_K
6214#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_K BSLSTL_OPTIONAL_VARIADIC_LIMIT
6216#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0
6217template <
class t_TYPE,
class t_ARG>
6222#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1
6223template <
class t_TYPE,
class t_ARG,
class t_ARGS_01>
6229#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2
6230template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6238#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3
6239template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6249#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4
6250template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6262#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5
6263template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6277#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6
6278template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6294#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7
6295template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6313#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8
6314template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6334#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9
6335template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6357#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10
6358template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
6383# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
6384 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
6386#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 0
6387template <
class t_TYPE,
class t_INIT_LIST_TYPE>
6389 std::initializer_list<t_INIT_LIST_TYPE> il);
6392#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 1
6393template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01>
6395 std::initializer_list<t_INIT_LIST_TYPE> il,
6399#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 2
6400template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6403 std::initializer_list<t_INIT_LIST_TYPE> il,
6408#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 3
6409template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6413 std::initializer_list<t_INIT_LIST_TYPE> il,
6419#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 4
6420template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6425 std::initializer_list<t_INIT_LIST_TYPE> il,
6432#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 5
6433template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6439 std::initializer_list<t_INIT_LIST_TYPE> il,
6447#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 6
6448template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6455 std::initializer_list<t_INIT_LIST_TYPE> il,
6464#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 7
6465template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6473 std::initializer_list<t_INIT_LIST_TYPE> il,
6483#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 8
6484template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6493 std::initializer_list<t_INIT_LIST_TYPE> il,
6504#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 9
6505template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6515 std::initializer_list<t_INIT_LIST_TYPE> il,
6527#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_K >= 10
6528template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6539 std::initializer_list<t_INIT_LIST_TYPE> il,
6557template <
class t_TYPE,
class t_ARG,
class... t_ARGS>
6562# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
6563 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
6565template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
6567 std::initializer_list<t_INIT_LIST_TYPE> il,
6592template <
class t_TYPE>
6599#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
6602#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
6603#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
6605#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_L
6606#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_L BSLSTL_OPTIONAL_VARIADIC_LIMIT
6608#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0
6609template <
class t_TYPE>
6615 BloombergLP::bslma::ConstructionUtil::construct(
6619 return d_buffer.
object();
6623#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1
6624template <
class t_TYPE>
6625template <
class t_ARGS_01>
6632 BloombergLP::bslma::ConstructionUtil::construct(
6637 return d_buffer.
object();
6641#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2
6642template <
class t_TYPE>
6643template <
class t_ARGS_01,
6652 BloombergLP::bslma::ConstructionUtil::construct(
6658 return d_buffer.
object();
6662#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3
6663template <
class t_TYPE>
6664template <
class t_ARGS_01,
6675 BloombergLP::bslma::ConstructionUtil::construct(
6682 return d_buffer.
object();
6686#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4
6687template <
class t_TYPE>
6688template <
class t_ARGS_01,
6701 BloombergLP::bslma::ConstructionUtil::construct(
6709 return d_buffer.
object();
6713#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5
6714template <
class t_TYPE>
6715template <
class t_ARGS_01,
6730 BloombergLP::bslma::ConstructionUtil::construct(
6739 return d_buffer.
object();
6743#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6
6744template <
class t_TYPE>
6745template <
class t_ARGS_01,
6762 BloombergLP::bslma::ConstructionUtil::construct(
6772 return d_buffer.
object();
6776#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7
6777template <
class t_TYPE>
6778template <
class t_ARGS_01,
6797 BloombergLP::bslma::ConstructionUtil::construct(
6808 return d_buffer.
object();
6812#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8
6813template <
class t_TYPE>
6814template <
class t_ARGS_01,
6835 BloombergLP::bslma::ConstructionUtil::construct(
6847 return d_buffer.
object();
6851#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9
6852template <
class t_TYPE>
6853template <
class t_ARGS_01,
6876 BloombergLP::bslma::ConstructionUtil::construct(
6889 return d_buffer.
object();
6893#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 10
6894template <
class t_TYPE>
6895template <
class t_ARGS_01,
6920 BloombergLP::bslma::ConstructionUtil::construct(
6934 return d_buffer.
object();
6939# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
6940#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 0
6941template <
class t_TYPE>
6942template <
class t_INIT_LIST_TYPE>
6945 std::initializer_list<t_INIT_LIST_TYPE> il)
6948 BloombergLP::bslma::ConstructionUtil::construct(
6953 return d_buffer.
object();
6957#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 1
6958template <
class t_TYPE>
6959template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
6962 std::initializer_list<t_INIT_LIST_TYPE> il,
6966 BloombergLP::bslma::ConstructionUtil::construct(
6972 return d_buffer.
object();
6976#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 2
6977template <
class t_TYPE>
6978template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
6982 std::initializer_list<t_INIT_LIST_TYPE> il,
6987 BloombergLP::bslma::ConstructionUtil::construct(
6994 return d_buffer.
object();
6998#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 3
6999template <
class t_TYPE>
7000template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7005 std::initializer_list<t_INIT_LIST_TYPE> il,
7011 BloombergLP::bslma::ConstructionUtil::construct(
7019 return d_buffer.
object();
7023#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 4
7024template <
class t_TYPE>
7025template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7031 std::initializer_list<t_INIT_LIST_TYPE> il,
7038 BloombergLP::bslma::ConstructionUtil::construct(
7047 return d_buffer.
object();
7051#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 5
7052template <
class t_TYPE>
7053template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7060 std::initializer_list<t_INIT_LIST_TYPE> il,
7068 BloombergLP::bslma::ConstructionUtil::construct(
7078 return d_buffer.
object();
7082#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 6
7083template <
class t_TYPE>
7084template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7092 std::initializer_list<t_INIT_LIST_TYPE> il,
7101 BloombergLP::bslma::ConstructionUtil::construct(
7112 return d_buffer.
object();
7116#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 7
7117template <
class t_TYPE>
7118template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7127 std::initializer_list<t_INIT_LIST_TYPE> il,
7137 BloombergLP::bslma::ConstructionUtil::construct(
7149 return d_buffer.
object();
7153#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 8
7154template <
class t_TYPE>
7155template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7165 std::initializer_list<t_INIT_LIST_TYPE> il,
7176 BloombergLP::bslma::ConstructionUtil::construct(
7189 return d_buffer.
object();
7193#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 9
7194template <
class t_TYPE>
7195template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7206 std::initializer_list<t_INIT_LIST_TYPE> il,
7218 BloombergLP::bslma::ConstructionUtil::construct(
7232 return d_buffer.
object();
7236#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_L >= 10
7237template <
class t_TYPE>
7238template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7250 std::initializer_list<t_INIT_LIST_TYPE> il,
7263 BloombergLP::bslma::ConstructionUtil::construct(
7278 return d_buffer.
object();
7286template <
class t_TYPE>
7287template <
class... t_ARGS>
7294 BloombergLP::bslma::ConstructionUtil::construct(
7299 return d_buffer.
object();
7302# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
7303template <
class t_TYPE>
7304template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
7307 std::initializer_list<t_INIT_LIST_TYPE> il,
7311 BloombergLP::bslma::ConstructionUtil::construct(
7317 return d_buffer.
object();
7323template <
class t_TYPE>
7328 bslma::DestructionUtil::destroy(d_buffer.
address());
7332# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
7333template <
class t_TYPE>
7340 return d_buffer.
object();
7343template <
class t_TYPE>
7350 return std::move(d_buffer.
object());
7353template <
class t_TYPE>
7360 return d_buffer.
object();
7365template <
class t_TYPE>
7372# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
7373template <
class t_TYPE>
7380 return d_buffer.
object();
7383template <
class t_TYPE>
7390 return std::move(d_buffer.
object());
7393template <
class t_TYPE>
7400 return d_buffer.
object();
7409template <
class t_TYPE,
bool t_IS_TRIVIALLY_DESTRUCTIBLE>
7424template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7430template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7436template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7439 const Optional_Base& original)
7441 if (original.has_value()) {
7446template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7449 BloombergLP::bslmf::MovableRef<Optional_Base> original)
7452: d_allocator(MoveUtil::access(original).get_allocator())
7454 Optional_Base& lvalue = original;
7456 if (lvalue.has_value()) {
7457 emplace(MoveUtil::move(*lvalue));
7461template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7462template <
class t_ANY_TYPE>
7465 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
7471template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7472template <
class t_ANY_TYPE>
7475 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
7476 const Optional_Base<t_ANY_TYPE>& original)
7478 if (original.has_value()) {
7479 emplace(original.value());
7483template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7484template <
class t_ANY_TYPE>
7487 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
7492 Optional_Base<t_ANY_TYPE>& lvalue = original;
7493 if (lvalue.has_value()) {
7494 emplace(MoveUtil::move(*lvalue));
7498template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7499template <
class t_ANY_TYPE>
7502 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
7506: d_allocator(MoveUtil::access(original).get_allocator())
7508 Optional_Base<t_ANY_TYPE>& lvalue = original;
7509 if (lvalue.has_value()) {
7510 emplace(MoveUtil::move(*lvalue));
7514# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
7515template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7516template <
class t_ANY_TYPE>
7518Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7519 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
7520 const std::optional<t_ANY_TYPE>& original)
7522 if (original.has_value()) {
7523 emplace(original.value());
7527template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7528template <
class t_ANY_TYPE>
7530Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7531 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
7532 std::optional<t_ANY_TYPE>&& original)
7534 if (original.has_value()) {
7535 emplace(std::move(original.value()));
7540#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
7543#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
7544#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
7546#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_M
7547#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_M BSLSTL_OPTIONAL_VARIADIC_LIMIT
7549#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 0
7550template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7552Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7559#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 1
7560template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7561template <
class t_ARGS_01>
7563Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7571#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 2
7572template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7573template <
class t_ARGS_01,
7576Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7586#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 3
7587template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7588template <
class t_ARGS_01,
7592Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7604#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 4
7605template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7606template <
class t_ARGS_01,
7611Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7625#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 5
7626template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7627template <
class t_ARGS_01,
7633Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7649#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 6
7650template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7651template <
class t_ARGS_01,
7658Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7676#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 7
7677template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7678template <
class t_ARGS_01,
7686Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7706#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 8
7707template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7708template <
class t_ARGS_01,
7717Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7739#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 9
7740template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7741template <
class t_ARGS_01,
7751Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7775#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 10
7776template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7777template <
class t_ARGS_01,
7788Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7815# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
7816#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 0
7817template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7818template <
class t_INIT_LIST_TYPE>
7820Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7822 std::initializer_list<t_INIT_LIST_TYPE> il)
7828#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 1
7829template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7830template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
7832Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7834 std::initializer_list<t_INIT_LIST_TYPE> il,
7841#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 2
7842template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7843template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7846Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7848 std::initializer_list<t_INIT_LIST_TYPE> il,
7857#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 3
7858template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7859template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7863Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7865 std::initializer_list<t_INIT_LIST_TYPE> il,
7876#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 4
7877template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7878template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7883Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7885 std::initializer_list<t_INIT_LIST_TYPE> il,
7898#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 5
7899template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7900template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7906Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7908 std::initializer_list<t_INIT_LIST_TYPE> il,
7923#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 6
7924template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7925template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7932Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7934 std::initializer_list<t_INIT_LIST_TYPE> il,
7951#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 7
7952template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7953template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7961Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7963 std::initializer_list<t_INIT_LIST_TYPE> il,
7982#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 8
7983template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
7984template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
7993Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
7995 std::initializer_list<t_INIT_LIST_TYPE> il,
8016#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 9
8017template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8018template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8028Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8030 std::initializer_list<t_INIT_LIST_TYPE> il,
8053#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_M >= 10
8054template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8055template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8066Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8068 std::initializer_list<t_INIT_LIST_TYPE> il,
8097template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8098template <
class... t_ARGS>
8100Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8107# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
8108template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8109template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
8111Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8113 std::initializer_list<t_INIT_LIST_TYPE> il,
8122template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8124Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8125 bsl::allocator_arg_t,
8126 allocator_type allocator)
8127: d_allocator(allocator)
8131template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8133Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8134 bsl::allocator_arg_t,
8135 allocator_type allocator,
8137: d_allocator(allocator)
8141template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8143Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8144 bsl::allocator_arg_t,
8145 allocator_type allocator,
8146 const Optional_Base& original)
8147: d_allocator(allocator)
8149 if (original.has_value()) {
8154template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8156Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8157 bsl::allocator_arg_t,
8158 allocator_type allocator,
8159 BloombergLP::bslmf::MovableRef<Optional_Base> original)
8160: d_allocator(allocator)
8162 Optional_Base& lvalue = original;
8164 if (lvalue.has_value()) {
8165 emplace(MoveUtil::move(*lvalue));
8169template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8170template <
class t_ANY_TYPE>
8172Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8173 bsl::allocator_arg_t,
8174 allocator_type allocator,
8175 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
8177: d_allocator(allocator)
8182template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8183template <
class t_ANY_TYPE>
8185Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8186 bsl::allocator_arg_t,
8187 allocator_type allocator,
8188 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
8189 const Optional_Base<t_ANY_TYPE>& original)
8190: d_allocator(allocator)
8192 if (original.has_value()) {
8193 emplace(original.value());
8197template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8198template <
class t_ANY_TYPE>
8200Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8201 bsl::allocator_arg_t,
8202 allocator_type allocator,
8203 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
8205: d_allocator(allocator)
8207 Optional_Base<t_ANY_TYPE>& lvalue = original;
8208 if (lvalue.has_value()) {
8209 emplace(MoveUtil::move(*lvalue));
8213# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
8214template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8215template <
class t_ANY_TYPE>
8217Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8218 bsl::allocator_arg_t,
8219 allocator_type allocator,
8220 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
8221 const std::optional<t_ANY_TYPE>& original)
8222: d_allocator(allocator)
8224 if (original.has_value()) {
8225 emplace(original.value());
8229template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8230template <
class t_ANY_TYPE>
8232Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8233 bsl::allocator_arg_t,
8234 allocator_type allocator,
8235 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
8236 std::optional<t_ANY_TYPE>&& original)
8237: d_allocator(allocator)
8239 if (original.has_value()) {
8240 emplace(std::move(original.value()));
8245#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
8248#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
8249#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
8251#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_N
8252#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_N BSLSTL_OPTIONAL_VARIADIC_LIMIT
8254#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 0
8255template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8257Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8258 bsl::allocator_arg_t,
8259 allocator_type alloc,
8267#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 1
8268template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8269template <
class t_ARGS_01>
8271Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8272 bsl::allocator_arg_t,
8273 allocator_type alloc,
8282#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 2
8283template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8284template <
class t_ARGS_01,
8287Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8288 bsl::allocator_arg_t,
8289 allocator_type alloc,
8300#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 3
8301template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8302template <
class t_ARGS_01,
8306Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8307 bsl::allocator_arg_t,
8308 allocator_type alloc,
8321#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 4
8322template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8323template <
class t_ARGS_01,
8328Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8329 bsl::allocator_arg_t,
8330 allocator_type alloc,
8345#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 5
8346template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8347template <
class t_ARGS_01,
8353Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8354 bsl::allocator_arg_t,
8355 allocator_type alloc,
8372#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 6
8373template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8374template <
class t_ARGS_01,
8381Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8382 bsl::allocator_arg_t,
8383 allocator_type alloc,
8402#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 7
8403template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8404template <
class t_ARGS_01,
8412Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8413 bsl::allocator_arg_t,
8414 allocator_type alloc,
8435#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 8
8436template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8437template <
class t_ARGS_01,
8446Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8447 bsl::allocator_arg_t,
8448 allocator_type alloc,
8471#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 9
8472template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8473template <
class t_ARGS_01,
8483Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8484 bsl::allocator_arg_t,
8485 allocator_type alloc,
8510#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 10
8511template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8512template <
class t_ARGS_01,
8523Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8524 bsl::allocator_arg_t,
8525 allocator_type alloc,
8553# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
8554#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 0
8555template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8556template <
class t_INIT_LIST_TYPE>
8558Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8559 bsl::allocator_arg_t,
8560 allocator_type alloc,
8562 std::initializer_list<t_INIT_LIST_TYPE> il)
8569#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 1
8570template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8571template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
8573Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8574 bsl::allocator_arg_t,
8575 allocator_type alloc,
8577 std::initializer_list<t_INIT_LIST_TYPE> il,
8585#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 2
8586template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8587template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8590Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8591 bsl::allocator_arg_t,
8592 allocator_type alloc,
8594 std::initializer_list<t_INIT_LIST_TYPE> il,
8604#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 3
8605template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8606template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8610Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8611 bsl::allocator_arg_t,
8612 allocator_type alloc,
8614 std::initializer_list<t_INIT_LIST_TYPE> il,
8626#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 4
8627template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8628template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8633Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8634 bsl::allocator_arg_t,
8635 allocator_type alloc,
8637 std::initializer_list<t_INIT_LIST_TYPE> il,
8651#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 5
8652template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8653template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8659Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8660 bsl::allocator_arg_t,
8661 allocator_type alloc,
8663 std::initializer_list<t_INIT_LIST_TYPE> il,
8679#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 6
8680template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8681template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8688Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8689 bsl::allocator_arg_t,
8690 allocator_type alloc,
8692 std::initializer_list<t_INIT_LIST_TYPE> il,
8710#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 7
8711template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8712template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8720Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8721 bsl::allocator_arg_t,
8722 allocator_type alloc,
8724 std::initializer_list<t_INIT_LIST_TYPE> il,
8744#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 8
8745template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8746template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8755Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8756 bsl::allocator_arg_t,
8757 allocator_type alloc,
8759 std::initializer_list<t_INIT_LIST_TYPE> il,
8781#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 9
8782template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8783template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8793Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8794 bsl::allocator_arg_t,
8795 allocator_type alloc,
8797 std::initializer_list<t_INIT_LIST_TYPE> il,
8821#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_N >= 10
8822template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8823template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
8834Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8835 bsl::allocator_arg_t,
8836 allocator_type alloc,
8838 std::initializer_list<t_INIT_LIST_TYPE> il,
8868template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8869template <
class... t_ARGS>
8871Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8872 bsl::allocator_arg_t,
8873 allocator_type alloc,
8881# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
8882template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8883template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
8885Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::Optional_Base(
8886 bsl::allocator_arg_t,
8887 allocator_type alloc,
8889 std::initializer_list<t_INIT_LIST_TYPE> il,
8900template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8901template <
class t_ANY_TYPE>
8902void Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::assignOrEmplace(
8912# ifndef BDE_OMIT_INTERNAL_DEPRECATED
8913template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8914t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::dereferenceRaw()
8919 return d_value.value();
8923template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8924const t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::dereferenceRaw()
const
8929 return d_value.value();
8934#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
8937#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
8938#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
8940#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_O
8941#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_O BSLSTL_OPTIONAL_VARIADIC_LIMIT
8943#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 0
8944template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8946t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
8949 return d_value.emplace(d_allocator.mechanism());
8953#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 1
8954template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8955template <
class t_ARGS_01>
8957t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
8960 return d_value.emplace(d_allocator.mechanism(),
8965#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 2
8966template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8967template <
class t_ARGS_01,
8970t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
8974 return d_value.emplace(d_allocator.mechanism(),
8980#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 3
8981template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
8982template <
class t_ARGS_01,
8986t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
8991 return d_value.emplace(d_allocator.mechanism(),
8998#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 4
8999template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9000template <
class t_ARGS_01,
9005t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9011 return d_value.emplace(d_allocator.mechanism(),
9019#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 5
9020template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9021template <
class t_ARGS_01,
9027t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9034 return d_value.emplace(d_allocator.mechanism(),
9043#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 6
9044template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9045template <
class t_ARGS_01,
9052t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9060 return d_value.emplace(d_allocator.mechanism(),
9070#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 7
9071template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9072template <
class t_ARGS_01,
9080t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9089 return d_value.emplace(d_allocator.mechanism(),
9100#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 8
9101template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9102template <
class t_ARGS_01,
9111t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9121 return d_value.emplace(d_allocator.mechanism(),
9133#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 9
9134template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9135template <
class t_ARGS_01,
9145t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9156 return d_value.emplace(d_allocator.mechanism(),
9169#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 10
9170template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9171template <
class t_ARGS_01,
9182t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9194 return d_value.emplace(d_allocator.mechanism(),
9209# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
9210#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 0
9211template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9212template <
class t_INIT_LIST_TYPE>
9213t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9214 std::initializer_list<t_INIT_LIST_TYPE> il)
9216 return d_value.emplace(d_allocator.mechanism(),
9221#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 1
9222template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9223template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
9224t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9225 std::initializer_list<t_INIT_LIST_TYPE> il,
9228 return d_value.emplace(d_allocator.mechanism(),
9234#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 2
9235template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9236template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9238t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9239 std::initializer_list<t_INIT_LIST_TYPE> il,
9243 return d_value.emplace(d_allocator.mechanism(),
9250#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 3
9251template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9252template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9255t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9256 std::initializer_list<t_INIT_LIST_TYPE> il,
9261 return d_value.emplace(d_allocator.mechanism(),
9269#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 4
9270template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9271template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9275t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9276 std::initializer_list<t_INIT_LIST_TYPE> il,
9282 return d_value.emplace(d_allocator.mechanism(),
9291#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 5
9292template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9293template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9298t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9299 std::initializer_list<t_INIT_LIST_TYPE> il,
9306 return d_value.emplace(d_allocator.mechanism(),
9316#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 6
9317template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9318template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9324t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9325 std::initializer_list<t_INIT_LIST_TYPE> il,
9333 return d_value.emplace(d_allocator.mechanism(),
9344#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 7
9345template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9346template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9353t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9354 std::initializer_list<t_INIT_LIST_TYPE> il,
9363 return d_value.emplace(d_allocator.mechanism(),
9375#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 8
9376template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9377template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9385t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9386 std::initializer_list<t_INIT_LIST_TYPE> il,
9396 return d_value.emplace(d_allocator.mechanism(),
9409#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 9
9410template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9411template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9420t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9421 std::initializer_list<t_INIT_LIST_TYPE> il,
9432 return d_value.emplace(d_allocator.mechanism(),
9446#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_O >= 10
9447template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9448template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
9458t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9459 std::initializer_list<t_INIT_LIST_TYPE> il,
9471 return d_value.emplace(d_allocator.mechanism(),
9490template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9491template <
class... t_ARGS>
9493t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9496 return d_value.emplace(d_allocator.mechanism(),
9500# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
9501template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9502template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
9503t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::emplace(
9504 std::initializer_list<t_INIT_LIST_TYPE> il,
9507 return d_value.emplace(d_allocator.mechanism(),
9515template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9522template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9523void Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::swap(Optional_Base& other)
9526 bsl::is_nothrow_swappable<t_TYPE>::value)
9530 if (this->has_value() && other.has_value()) {
9531 BloombergLP::bslalg::SwapUtil::swap(
9535 else if (this->has_value()) {
9536 other.emplace(MoveUtil::move(d_value.value()));
9539 else if (other.has_value()) {
9540 this->emplace(MoveUtil::move(*other));
9545# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9546template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9548t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value() &
9553 return d_value.value();
9556template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9558t_TYPE&& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value() &&
9563 return std::move(d_value.value());
9567template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9569t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value()
9574 return d_value.value();
9579# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9580template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9581template <
class t_ANY_TYPE>
9583t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9584 t_ANY_TYPE&& value) &&
9587 return t_TYPE(std::move(d_value.value()));
9590 return t_TYPE(std::forward<t_ANY_TYPE>(value));
9594# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
9595template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9596template <
class t_ANY_TYPE>
9598t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9599 bsl::allocator_arg_t,
9600 allocator_type allocator,
9601 t_ANY_TYPE&& value) &&
9604 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9606 std::move(d_value.value()));
9609 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9611 std::forward<t_ANY_TYPE>(value));
9617template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9619Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>&
9620Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator=(
const Optional_Base& rhs)
9622 if (rhs.has_value()) {
9623 if (this->has_value()) {
9624 d_value.value() = *rhs;
9636template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9638Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>&
9639Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator=(
9640 BloombergLP::bslmf::MovableRef<Optional_Base> rhs)
9642 Optional_Base& lvalue = rhs;
9644 if (lvalue.has_value()) {
9645 if (this->has_value()) {
9646 d_value.value() = MoveUtil::move(*lvalue);
9649 emplace(MoveUtil::move(*lvalue));
9658template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9660t_TYPE *Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator->()
9667# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9668template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9670t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*() &
9674 return d_value.value();
9677template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9679t_TYPE&& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*() &&
9683 return std::move(d_value.value());
9687template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9689t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*()
9693 return d_value.value();
9700template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9702typename Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::allocator_type
9703Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::get_allocator() const
9709template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9712Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::has_value() const
9715 return d_value.hasValue();
9718# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9719template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9721const t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value() const&
9726 return d_value.value();
9729template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9731const t_TYPE&& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value() const&&
9736 return std::move(d_value.value());
9740template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9742const t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value()
const
9747 return d_value.value();
9752# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9753template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9754template <
class t_ANY_TYPE>
9756t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9760 return t_TYPE(d_value.value());
9768# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
9769template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9770template <
class t_ANY_TYPE>
9772t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9773 bsl::allocator_arg_t,
9774 allocator_type allocator,
9778 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9779 allocator, d_value.value());
9782 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9789template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9790template <
class t_ANY_TYPE>
9792t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9796 return t_TYPE(d_value.value());
9804# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
9805template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9806template <
class t_ANY_TYPE>
9808t_TYPE Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::value_or(
9809 bsl::allocator_arg_t,
9810 allocator_type allocator,
9814 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9815 allocator, d_value.value());
9818 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
9826template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9828const t_TYPE *Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator->()
const
9835# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
9836template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9838const t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*() const&
9842 return d_value.value();
9845template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9847const t_TYPE&& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*() const&&
9851 return std::move(d_value.value());
9855template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9857const t_TYPE& Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator*()
const
9861 return d_value.value();
9865#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
9866template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
9867Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>::operator bool() const
9882# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
9884template <
class t_TYPE>
9886Optional_Base<t_TYPE, false>::Optional_Base()
9890template <
class t_TYPE>
9896template <
class t_TYPE>
9897template <
class t_ANY_TYPE>
9899Optional_Base<t_TYPE, false>::Optional_Base(
9900 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
9902: StdOptionalBase(
std::forward<t_ANY_TYPE>(value))
9906template <
class t_TYPE>
9907template <
class t_ANY_TYPE>
9909Optional_Base<t_TYPE, false>::Optional_Base(
9910 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
9911 const Optional_Base<t_ANY_TYPE>& original)
9913 if (original.has_value()) {
9914 this->emplace(original.value());
9918template <
class t_TYPE>
9919template <
class t_ANY_TYPE>
9921Optional_Base<t_TYPE, false>::Optional_Base(
9922 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
9923 Optional_Base<t_ANY_TYPE>&& original)
9925 if (original.has_value()) {
9926 this->emplace(std::move(original.value()));
9930template <
class t_TYPE>
9931template <
class t_ANY_TYPE>
9933Optional_Base<t_TYPE, false>::Optional_Base(
9934 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
9935 const std::optional<t_ANY_TYPE>& original)
9936: StdOptionalBase(original)
9940template <
class t_TYPE>
9941template <
class t_ANY_TYPE>
9943Optional_Base<t_TYPE, false>::Optional_Base(
9944 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
9945 std::optional<t_ANY_TYPE>&& original)
9946: StdOptionalBase(
std::move(original))
9950template <
class t_TYPE>
9951template <
class... t_ARGS>
9953Optional_Base<t_TYPE, false>::Optional_Base(
bsl::in_place_t, t_ARGS&&... args)
9958template <
class t_TYPE>
9959template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
9961Optional_Base<t_TYPE, false>::Optional_Base(
9963 std::initializer_list<t_INIT_LIST_TYPE> il,
9965: StdOptionalBase(
bsl::
in_place, il,
std::forward<t_ARGS>(args)...)
9969template <
class t_TYPE>
9971Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t, AllocType)
9976template <
class t_TYPE>
9978Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t,
9985template <
class t_TYPE>
9986template <
class t_ANY_TYPE>
9988Optional_Base<t_TYPE, false>::Optional_Base(
9989 bsl::allocator_arg_t,
9991 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
9997template <
class t_TYPE>
9998template <
class t_ANY_TYPE>
10000Optional_Base<t_TYPE, false>::Optional_Base(
10001 bsl::allocator_arg_t,
10003 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
10004 const Optional_Base<t_ANY_TYPE>&)
10009template <
class t_TYPE>
10010template <
class t_ANY_TYPE>
10012Optional_Base<t_TYPE, false>::Optional_Base(
10013 bsl::allocator_arg_t,
10015 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
10016 Optional_Base<t_ANY_TYPE>&&)
10021template <
class t_TYPE>
10022template <
class t_ANY_TYPE>
10024Optional_Base<t_TYPE, false>::Optional_Base(
10025 bsl::allocator_arg_t,
10027 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
10028 const std::optional<t_ANY_TYPE>&)
10033template <
class t_TYPE>
10034template <
class t_ANY_TYPE>
10036Optional_Base<t_TYPE, false>::Optional_Base(
10037 bsl::allocator_arg_t,
10039 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
10040 std::optional<t_ANY_TYPE>&&)
10045template <
class t_TYPE>
10046template <
class... t_ARGS>
10048Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t,
10056template <
class t_TYPE>
10057template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
10059Optional_Base<t_TYPE, false>::Optional_Base(
10060 bsl::allocator_arg_t,
10063 std::initializer_list<t_INIT_LIST_TYPE>,
10070template <
class t_TYPE>
10071template <
class t_ANY_TYPE>
10072void Optional_Base<t_TYPE, false>::assignOrEmplace(t_ANY_TYPE&& rhs)
10074 StdOptionalBase::operator=(std::forward<t_ANY_TYPE>(rhs));
10077# ifndef BDE_OMIT_INTERNAL_DEPRECATED
10078template <
class t_TYPE>
10079t_TYPE& Optional_Base<t_TYPE, false>::dereferenceRaw()
10089template <
class t_TYPE>
10090const t_TYPE& Optional_Base<t_TYPE, false>::dereferenceRaw()
const
10106template <
class t_TYPE>
10108Optional_Base<t_TYPE, false>::Optional_Base()
10112template <
class t_TYPE>
10118template <
class t_TYPE>
10120Optional_Base<t_TYPE, false>::Optional_Base(
const Optional_Base& original)
10122 if (original.has_value()) {
10123 emplace(original.value());
10127template <
class t_TYPE>
10129Optional_Base<t_TYPE, false>::Optional_Base(
10130 BloombergLP::bslmf::MovableRef<Optional_Base> original)
10134 Optional_Base& lvalue = original;
10136 if (lvalue.has_value()) {
10137 emplace(MoveUtil::move(*lvalue));
10141template <
class t_TYPE>
10142template <
class t_ANY_TYPE>
10144Optional_Base<t_TYPE, false>::Optional_Base(
10145 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
10151template <
class t_TYPE>
10152template <
class t_ANY_TYPE>
10154Optional_Base<t_TYPE, false>::Optional_Base(
10155 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
10156 const Optional_Base<t_ANY_TYPE>& original)
10158 if (original.has_value()) {
10159 emplace(original.value());
10163template <
class t_TYPE>
10164template <
class t_ANY_TYPE>
10166Optional_Base<t_TYPE, false>::Optional_Base(
10167 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
10170 Optional_Base<t_ANY_TYPE>& lvalue = original;
10171 if (lvalue.has_value()) {
10172 emplace(MoveUtil::move(*lvalue));
10176#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
10179#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
10180#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
10182#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_P
10183#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_P BSLSTL_OPTIONAL_VARIADIC_LIMIT
10185#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 0
10186template <
class t_TYPE>
10188Optional_Base<t_TYPE, false>::Optional_Base(
10195#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 1
10196template <
class t_TYPE>
10197template <
class t_ARGS_01>
10199Optional_Base<t_TYPE, false>::Optional_Base(
10207#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 2
10208template <
class t_TYPE>
10209template <
class t_ARGS_01,
10212Optional_Base<t_TYPE, false>::Optional_Base(
10222#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 3
10223template <
class t_TYPE>
10224template <
class t_ARGS_01,
10228Optional_Base<t_TYPE, false>::Optional_Base(
10240#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 4
10241template <
class t_TYPE>
10242template <
class t_ARGS_01,
10247Optional_Base<t_TYPE, false>::Optional_Base(
10261#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 5
10262template <
class t_TYPE>
10263template <
class t_ARGS_01,
10269Optional_Base<t_TYPE, false>::Optional_Base(
10285#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 6
10286template <
class t_TYPE>
10287template <
class t_ARGS_01,
10294Optional_Base<t_TYPE, false>::Optional_Base(
10312#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 7
10313template <
class t_TYPE>
10314template <
class t_ARGS_01,
10322Optional_Base<t_TYPE, false>::Optional_Base(
10342#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 8
10343template <
class t_TYPE>
10344template <
class t_ARGS_01,
10353Optional_Base<t_TYPE, false>::Optional_Base(
10375#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 9
10376template <
class t_TYPE>
10377template <
class t_ARGS_01,
10387Optional_Base<t_TYPE, false>::Optional_Base(
10411#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 10
10412template <
class t_TYPE>
10413template <
class t_ARGS_01,
10424Optional_Base<t_TYPE, false>::Optional_Base(
10451# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
10452#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 0
10453template <
class t_TYPE>
10454template <
class t_INIT_LIST_TYPE>
10456Optional_Base<t_TYPE, false>::Optional_Base(
10458 std::initializer_list<t_INIT_LIST_TYPE> il)
10464#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 1
10465template <
class t_TYPE>
10466template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
10468Optional_Base<t_TYPE, false>::Optional_Base(
10470 std::initializer_list<t_INIT_LIST_TYPE> il,
10477#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 2
10478template <
class t_TYPE>
10479template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10482Optional_Base<t_TYPE, false>::Optional_Base(
10484 std::initializer_list<t_INIT_LIST_TYPE> il,
10493#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 3
10494template <
class t_TYPE>
10495template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10499Optional_Base<t_TYPE, false>::Optional_Base(
10501 std::initializer_list<t_INIT_LIST_TYPE> il,
10512#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 4
10513template <
class t_TYPE>
10514template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10519Optional_Base<t_TYPE, false>::Optional_Base(
10521 std::initializer_list<t_INIT_LIST_TYPE> il,
10534#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 5
10535template <
class t_TYPE>
10536template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10542Optional_Base<t_TYPE, false>::Optional_Base(
10544 std::initializer_list<t_INIT_LIST_TYPE> il,
10559#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 6
10560template <
class t_TYPE>
10561template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10568Optional_Base<t_TYPE, false>::Optional_Base(
10570 std::initializer_list<t_INIT_LIST_TYPE> il,
10587#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 7
10588template <
class t_TYPE>
10589template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10597Optional_Base<t_TYPE, false>::Optional_Base(
10599 std::initializer_list<t_INIT_LIST_TYPE> il,
10618#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 8
10619template <
class t_TYPE>
10620template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10629Optional_Base<t_TYPE, false>::Optional_Base(
10631 std::initializer_list<t_INIT_LIST_TYPE> il,
10652#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 9
10653template <
class t_TYPE>
10654template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10664Optional_Base<t_TYPE, false>::Optional_Base(
10666 std::initializer_list<t_INIT_LIST_TYPE> il,
10689#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_P >= 10
10690template <
class t_TYPE>
10691template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
10702Optional_Base<t_TYPE, false>::Optional_Base(
10704 std::initializer_list<t_INIT_LIST_TYPE> il,
10733template <
class t_TYPE>
10734template <
class... t_ARGS>
10736Optional_Base<t_TYPE, false>::Optional_Base(
10743# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
10744template <
class t_TYPE>
10745template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
10747Optional_Base<t_TYPE, false>::Optional_Base(
10749 std::initializer_list<t_INIT_LIST_TYPE> il,
10758template <
class t_TYPE>
10760Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t, AllocType)
10765template <
class t_TYPE>
10767Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t,
10774template <
class t_TYPE>
10776Optional_Base<t_TYPE, false>::Optional_Base(bsl::allocator_arg_t,
10778 const Optional_Base&)
10783template <
class t_TYPE>
10785Optional_Base<t_TYPE, false>::Optional_Base(
10786 bsl::allocator_arg_t,
10788 BloombergLP::bslmf::MovableRef<Optional_Base>)
10793template <
class t_TYPE>
10794template <
class t_ANY_TYPE>
10796Optional_Base<t_TYPE, false>::Optional_Base(
10797 bsl::allocator_arg_t,
10799 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
10805template <
class t_TYPE>
10806template <
class t_ANY_TYPE>
10808Optional_Base<t_TYPE, false>::Optional_Base(
10809 bsl::allocator_arg_t,
10811 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
10812 const Optional_Base<t_ANY_TYPE>&)
10817template <
class t_TYPE>
10818template <
class t_ANY_TYPE>
10820Optional_Base<t_TYPE, false>::Optional_Base(
10821 bsl::allocator_arg_t,
10823 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
10829#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
10832#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
10833#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
10835#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q
10836#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q BSLSTL_OPTIONAL_VARIADIC_LIMIT
10838#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 0
10839template <
class t_TYPE>
10841Optional_Base<t_TYPE, false>::Optional_Base(
10842 bsl::allocator_arg_t,
10850#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 1
10851template <
class t_TYPE>
10852template <
class t_ARGS_01>
10854Optional_Base<t_TYPE, false>::Optional_Base(
10855 bsl::allocator_arg_t,
10864#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 2
10865template <
class t_TYPE>
10866template <
class t_ARGS_01,
10869Optional_Base<t_TYPE, false>::Optional_Base(
10870 bsl::allocator_arg_t,
10880#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 3
10881template <
class t_TYPE>
10882template <
class t_ARGS_01,
10886Optional_Base<t_TYPE, false>::Optional_Base(
10887 bsl::allocator_arg_t,
10898#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 4
10899template <
class t_TYPE>
10900template <
class t_ARGS_01,
10905Optional_Base<t_TYPE, false>::Optional_Base(
10906 bsl::allocator_arg_t,
10918#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 5
10919template <
class t_TYPE>
10920template <
class t_ARGS_01,
10926Optional_Base<t_TYPE, false>::Optional_Base(
10927 bsl::allocator_arg_t,
10940#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 6
10941template <
class t_TYPE>
10942template <
class t_ARGS_01,
10949Optional_Base<t_TYPE, false>::Optional_Base(
10950 bsl::allocator_arg_t,
10964#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 7
10965template <
class t_TYPE>
10966template <
class t_ARGS_01,
10974Optional_Base<t_TYPE, false>::Optional_Base(
10975 bsl::allocator_arg_t,
10990#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 8
10991template <
class t_TYPE>
10992template <
class t_ARGS_01,
11001Optional_Base<t_TYPE, false>::Optional_Base(
11002 bsl::allocator_arg_t,
11018#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 9
11019template <
class t_TYPE>
11020template <
class t_ARGS_01,
11030Optional_Base<t_TYPE, false>::Optional_Base(
11031 bsl::allocator_arg_t,
11048#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 10
11049template <
class t_TYPE>
11050template <
class t_ARGS_01,
11061Optional_Base<t_TYPE, false>::Optional_Base(
11062 bsl::allocator_arg_t,
11081# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
11082#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 0
11083template <
class t_TYPE>
11084template <
class t_INIT_LIST_TYPE>
11086Optional_Base<t_TYPE, false>::Optional_Base(
11087 bsl::allocator_arg_t,
11090 std::initializer_list<t_INIT_LIST_TYPE>)
11096#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 1
11097template <
class t_TYPE>
11098template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
11100Optional_Base<t_TYPE, false>::Optional_Base(
11101 bsl::allocator_arg_t,
11104 std::initializer_list<t_INIT_LIST_TYPE>,
11111#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 2
11112template <
class t_TYPE>
11113template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11116Optional_Base<t_TYPE, false>::Optional_Base(
11117 bsl::allocator_arg_t,
11120 std::initializer_list<t_INIT_LIST_TYPE>,
11128#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 3
11129template <
class t_TYPE>
11130template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11134Optional_Base<t_TYPE, false>::Optional_Base(
11135 bsl::allocator_arg_t,
11138 std::initializer_list<t_INIT_LIST_TYPE>,
11147#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 4
11148template <
class t_TYPE>
11149template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11154Optional_Base<t_TYPE, false>::Optional_Base(
11155 bsl::allocator_arg_t,
11158 std::initializer_list<t_INIT_LIST_TYPE>,
11168#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 5
11169template <
class t_TYPE>
11170template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11176Optional_Base<t_TYPE, false>::Optional_Base(
11177 bsl::allocator_arg_t,
11180 std::initializer_list<t_INIT_LIST_TYPE>,
11191#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 6
11192template <
class t_TYPE>
11193template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11200Optional_Base<t_TYPE, false>::Optional_Base(
11201 bsl::allocator_arg_t,
11204 std::initializer_list<t_INIT_LIST_TYPE>,
11216#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 7
11217template <
class t_TYPE>
11218template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11226Optional_Base<t_TYPE, false>::Optional_Base(
11227 bsl::allocator_arg_t,
11230 std::initializer_list<t_INIT_LIST_TYPE>,
11243#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 8
11244template <
class t_TYPE>
11245template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11254Optional_Base<t_TYPE, false>::Optional_Base(
11255 bsl::allocator_arg_t,
11258 std::initializer_list<t_INIT_LIST_TYPE>,
11272#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 9
11273template <
class t_TYPE>
11274template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11284Optional_Base<t_TYPE, false>::Optional_Base(
11285 bsl::allocator_arg_t,
11288 std::initializer_list<t_INIT_LIST_TYPE>,
11303#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_Q >= 10
11304template <
class t_TYPE>
11305template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11316Optional_Base<t_TYPE, false>::Optional_Base(
11317 bsl::allocator_arg_t,
11320 std::initializer_list<t_INIT_LIST_TYPE>,
11340template <
class t_TYPE>
11341template <
class... t_ARGS>
11343Optional_Base<t_TYPE, false>::Optional_Base(
11344 bsl::allocator_arg_t,
11352# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
11353template <
class t_TYPE>
11354template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
11356Optional_Base<t_TYPE, false>::Optional_Base(
11357 bsl::allocator_arg_t,
11360 std::initializer_list<t_INIT_LIST_TYPE>,
11370template <
class t_TYPE>
11371template <
class t_ANY_TYPE>
11372void Optional_Base<t_TYPE, false>::assignOrEmplace(
11382# ifndef BDE_OMIT_INTERNAL_DEPRECATED
11383template <
class t_TYPE>
11384t_TYPE& Optional_Base<t_TYPE, false>::dereferenceRaw()
11389 return d_value.value();
11394template <
class t_TYPE>
11395const t_TYPE& Optional_Base<t_TYPE, false>::dereferenceRaw()
const
11400 return d_value.value();
11406#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
11409#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
11410#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
11412#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_R
11413#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_R BSLSTL_OPTIONAL_VARIADIC_LIMIT
11415#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 0
11416template <
class t_TYPE>
11419Optional_Base<t_TYPE, false>::emplace(
11422 return d_value.emplace(NULL);
11426#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 1
11427template <
class t_TYPE>
11428template <
class t_ARGS_01>
11431Optional_Base<t_TYPE, false>::emplace(
11434 return d_value.emplace(NULL,
11439#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 2
11440template <
class t_TYPE>
11441template <
class t_ARGS_01,
11445Optional_Base<t_TYPE, false>::emplace(
11449 return d_value.emplace(NULL,
11455#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 3
11456template <
class t_TYPE>
11457template <
class t_ARGS_01,
11462Optional_Base<t_TYPE, false>::emplace(
11467 return d_value.emplace(NULL,
11474#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 4
11475template <
class t_TYPE>
11476template <
class t_ARGS_01,
11482Optional_Base<t_TYPE, false>::emplace(
11488 return d_value.emplace(NULL,
11496#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 5
11497template <
class t_TYPE>
11498template <
class t_ARGS_01,
11505Optional_Base<t_TYPE, false>::emplace(
11512 return d_value.emplace(NULL,
11521#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 6
11522template <
class t_TYPE>
11523template <
class t_ARGS_01,
11531Optional_Base<t_TYPE, false>::emplace(
11539 return d_value.emplace(NULL,
11549#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 7
11550template <
class t_TYPE>
11551template <
class t_ARGS_01,
11560Optional_Base<t_TYPE, false>::emplace(
11569 return d_value.emplace(NULL,
11580#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 8
11581template <
class t_TYPE>
11582template <
class t_ARGS_01,
11592Optional_Base<t_TYPE, false>::emplace(
11602 return d_value.emplace(NULL,
11614#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 9
11615template <
class t_TYPE>
11616template <
class t_ARGS_01,
11627Optional_Base<t_TYPE, false>::emplace(
11638 return d_value.emplace(NULL,
11651#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 10
11652template <
class t_TYPE>
11653template <
class t_ARGS_01,
11665Optional_Base<t_TYPE, false>::emplace(
11677 return d_value.emplace(NULL,
11692# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
11693#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 0
11694template <
class t_TYPE>
11695template <
class t_INIT_LIST_TYPE>
11696t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11697 std::initializer_list<t_INIT_LIST_TYPE> il)
11699 return d_value.emplace(
11704#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 1
11705template <
class t_TYPE>
11706template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
11707t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11708 std::initializer_list<t_INIT_LIST_TYPE> il,
11711 return d_value.emplace(
11716#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 2
11717template <
class t_TYPE>
11718template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11720t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11721 std::initializer_list<t_INIT_LIST_TYPE> il,
11725 return d_value.emplace(
11731#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 3
11732template <
class t_TYPE>
11733template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11736t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11737 std::initializer_list<t_INIT_LIST_TYPE> il,
11742 return d_value.emplace(
11749#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 4
11750template <
class t_TYPE>
11751template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11755t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11756 std::initializer_list<t_INIT_LIST_TYPE> il,
11762 return d_value.emplace(
11770#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 5
11771template <
class t_TYPE>
11772template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11777t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11778 std::initializer_list<t_INIT_LIST_TYPE> il,
11785 return d_value.emplace(
11794#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 6
11795template <
class t_TYPE>
11796template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11802t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11803 std::initializer_list<t_INIT_LIST_TYPE> il,
11811 return d_value.emplace(
11821#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 7
11822template <
class t_TYPE>
11823template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11830t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11831 std::initializer_list<t_INIT_LIST_TYPE> il,
11840 return d_value.emplace(
11851#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 8
11852template <
class t_TYPE>
11853template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11861t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11862 std::initializer_list<t_INIT_LIST_TYPE> il,
11872 return d_value.emplace(
11884#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 9
11885template <
class t_TYPE>
11886template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11895t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11896 std::initializer_list<t_INIT_LIST_TYPE> il,
11907 return d_value.emplace(
11920#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_R >= 10
11921template <
class t_TYPE>
11922template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
11932t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11933 std::initializer_list<t_INIT_LIST_TYPE> il,
11945 return d_value.emplace(
11963template <
class t_TYPE>
11964template <
class... t_ARGS>
11967Optional_Base<t_TYPE, false>::emplace(
11970 return d_value.emplace(NULL,
11974# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
11975template <
class t_TYPE>
11976template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
11977t_TYPE& Optional_Base<t_TYPE, false>::emplace(
11978 std::initializer_list<t_INIT_LIST_TYPE> il,
11981 return d_value.emplace(
11988template <
class t_TYPE>
11995template <
class t_TYPE>
11996void Optional_Base<t_TYPE, false>::swap(Optional_Base& other)
11999 bsl::is_nothrow_swappable<t_TYPE>::value)
12001 if (this->has_value() && other.has_value()) {
12002 BloombergLP::bslalg::SwapUtil::swap(
12006 else if (this->has_value()) {
12007 other.emplace(MoveUtil::move(d_value.value()));
12010 else if (other.has_value()) {
12011 this->emplace(MoveUtil::move(*other));
12016# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12017template <
class t_TYPE>
12019t_TYPE& Optional_Base<t_TYPE, false>::value() &
12024 return d_value.value();
12026template <
class t_TYPE>
12029Optional_Base<t_TYPE, false>::value() &&
12034 return std::move(d_value.value());
12038template <
class t_TYPE>
12040t_TYPE& Optional_Base<t_TYPE, false>::value()
12045 return d_value.value();
12050# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12051template <
class t_TYPE>
12052template <
class t_ANY_TYPE>
12055Optional_Base<t_TYPE, false>::value_or(t_ANY_TYPE&& value) &&
12058 return t_TYPE(std::move(d_value.value()));
12061 return t_TYPE(std::forward<t_ANY_TYPE>(value));
12066template <
class t_TYPE>
12068Optional_Base<t_TYPE, false>&
12069Optional_Base<t_TYPE, false>::operator=(
const Optional_Base& rhs)
12071 if (rhs.has_value()) {
12072 if (this->has_value()) {
12073 d_value.value() = *rhs;
12085template <
class t_TYPE>
12087Optional_Base<t_TYPE, false>&
12088Optional_Base<t_TYPE, false>::operator=(
12089 BloombergLP::bslmf::MovableRef<Optional_Base> rhs)
12091 Optional_Base& lvalue = rhs;
12092 if (lvalue.has_value()) {
12093 if (this->has_value()) {
12094 d_value.value() = MoveUtil::move(*lvalue);
12097 emplace(MoveUtil::move(*lvalue));
12106# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12107template <
class t_TYPE>
12109t_TYPE& Optional_Base<t_TYPE, false>::operator*() &
12113 return d_value.value();
12116template <
class t_TYPE>
12118t_TYPE&& Optional_Base<t_TYPE, false>::operator*() &&
12122 return std::move(d_value.value());
12125template <
class t_TYPE>
12127t_TYPE& Optional_Base<t_TYPE, false>::operator*()
12131 return d_value.value();
12135template <
class t_TYPE>
12137t_TYPE *Optional_Base<t_TYPE, false>::operator->()
12146template <
class t_TYPE>
12150 return d_value.hasValue();
12153# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12154template <
class t_TYPE>
12157Optional_Base<t_TYPE, false>::value() const&
12162 return d_value.value();
12165template <
class t_TYPE>
12168Optional_Base<t_TYPE, false>::value() const&&
12173 return std::move(d_value.value());
12177template <
class t_TYPE>
12180Optional_Base<t_TYPE, false>::value()
const
12185 return d_value.value();
12190# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12192template <
class t_TYPE>
12193template <
class t_ANY_TYPE>
12196Optional_Base<t_TYPE, false>::value_or(
12201 return t_TYPE(d_value.value());
12210template <
class t_TYPE>
12211template <
class t_ANY_TYPE>
12214Optional_Base<t_TYPE, false>::value_or(
12219 return t_TYPE(d_value.value());
12229template <
class t_TYPE>
12231const t_TYPE *Optional_Base<t_TYPE, false>::operator->()
const
12238# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
12239template <
class t_TYPE>
12241const t_TYPE& Optional_Base<t_TYPE, false>::operator*() const&
12245 return d_value.value();
12248template <
class t_TYPE>
12250const t_TYPE&& Optional_Base<t_TYPE, false>::operator*() const&&
12254 return std::move(d_value.value());
12258template <
class t_TYPE>
12260const t_TYPE& Optional_Base<t_TYPE, false>::operator*()
const
12264 return d_value.value();
12268#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
12269template <
class t_TYPE>
12272 return has_value();
12291template <
class t_TYPE>
12297template <
class t_TYPE>
12303#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
12304template <
class t_TYPE>
12305template <
class t_DERIVED>
12307 BloombergLP::bslmf::MovableRef<t_DERIVED> original,
12311: BaseType(MoveUtil::move(static_cast<BaseType&>(original)))
12316template <
class t_TYPE>
12317template <
class t_ANY_TYPE>
12322: BaseType(BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
12327template <
class t_TYPE>
12328template <
class t_ANY_TYPE>
12329optional<t_TYPE>::optional(
12333: BaseType(BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
12338template <
class t_TYPE>
12339template <
class t_ANY_TYPE>
12340optional<t_TYPE>::optional(
12341 const optional<t_ANY_TYPE>& original,
12343 const t_ANY_TYPE&),
12345 const t_ANY_TYPE&))
12346: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
12351template <
class t_TYPE>
12352template <
class t_ANY_TYPE>
12353optional<t_TYPE>::optional(
12354 const optional<t_ANY_TYPE>& original,
12356 const t_ANY_TYPE&),
12358: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
12363template <
class t_TYPE>
12364template <
class t_ANY_TYPE>
12365optional<t_TYPE>::optional(
12369: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
12371 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
12376template <
class t_TYPE>
12377template <
class t_ANY_TYPE>
12378optional<t_TYPE>::optional(
12382: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
12384 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
12389#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
12390template <
class t_TYPE>
12391template <
class t_ANY_TYPE>
12392optional<t_TYPE>::optional(
12393 const std::optional<t_ANY_TYPE>& original,
12395 const t_ANY_TYPE&),
12397: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
12402template <
class t_TYPE>
12403template <
class t_ANY_TYPE>
12404optional<t_TYPE>::optional(
12405 const std::optional<t_ANY_TYPE>& original,
12407 const t_ANY_TYPE&),
12409: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
12414template <
class t_TYPE>
12415template <
class t_ANY_TYPE>
12416optional<t_TYPE>::optional(
12417 std::optional<t_ANY_TYPE>&& original,
12420: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
12421 std::move(original))
12425template <
class t_TYPE>
12426template <
class t_ANY_TYPE>
12427optional<t_TYPE>::optional(
12428 std::optional<t_ANY_TYPE>&& original,
12431: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
12432 std::move(original))
12437#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
12440#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
12441#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
12443#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_S
12444#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_S BSLSTL_OPTIONAL_VARIADIC_LIMIT
12446#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 0
12447template <
class t_TYPE>
12454#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 1
12455template <
class t_TYPE>
12456template <
class t_ARGS_01>
12464#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 2
12465template <
class t_TYPE>
12466template <
class t_ARGS_01,
12477#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 3
12478template <
class t_TYPE>
12479template <
class t_ARGS_01,
12493#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 4
12494template <
class t_TYPE>
12495template <
class t_ARGS_01,
12512#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 5
12513template <
class t_TYPE>
12514template <
class t_ARGS_01,
12534#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 6
12535template <
class t_TYPE>
12536template <
class t_ARGS_01,
12559#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 7
12560template <
class t_TYPE>
12561template <
class t_ARGS_01,
12587#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 8
12588template <
class t_TYPE>
12589template <
class t_ARGS_01,
12618#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 9
12619template <
class t_TYPE>
12620template <
class t_ARGS_01,
12652#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 10
12653template <
class t_TYPE>
12654template <
class t_ARGS_01,
12689#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
12690#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 0
12691template <
class t_TYPE>
12692template <
class t_INIT_LIST_TYPE>
12694 std::initializer_list<t_INIT_LIST_TYPE> il)
12700#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 1
12701template <
class t_TYPE>
12702template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
12704 std::initializer_list<t_INIT_LIST_TYPE> il,
12711#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 2
12712template <
class t_TYPE>
12713template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12716 std::initializer_list<t_INIT_LIST_TYPE> il,
12725#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 3
12726template <
class t_TYPE>
12727template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12731 std::initializer_list<t_INIT_LIST_TYPE> il,
12742#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 4
12743template <
class t_TYPE>
12744template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12749 std::initializer_list<t_INIT_LIST_TYPE> il,
12762#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 5
12763template <
class t_TYPE>
12764template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12770 std::initializer_list<t_INIT_LIST_TYPE> il,
12785#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 6
12786template <
class t_TYPE>
12787template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12794 std::initializer_list<t_INIT_LIST_TYPE> il,
12811#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 7
12812template <
class t_TYPE>
12813template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12821 std::initializer_list<t_INIT_LIST_TYPE> il,
12840#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 8
12841template <
class t_TYPE>
12842template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12851 std::initializer_list<t_INIT_LIST_TYPE> il,
12872#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 9
12873template <
class t_TYPE>
12874template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12884 std::initializer_list<t_INIT_LIST_TYPE> il,
12907#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_S >= 10
12908template <
class t_TYPE>
12909template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
12920 std::initializer_list<t_INIT_LIST_TYPE> il,
12949template <
class t_TYPE>
12950template <
class... t_ARGS>
12956#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
12957template <
class t_TYPE>
12958template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
12960 std::initializer_list<t_INIT_LIST_TYPE> il,
12969template <
class t_TYPE>
12970optional<t_TYPE>::optional(bsl::allocator_arg_t, AllocType allocator)
12971: BaseType(
bsl::allocator_arg, allocator)
12975template <
class t_TYPE>
12976optional<t_TYPE>::optional(bsl::allocator_arg_t,
12977 AllocType allocator,
12979: BaseType(
bsl::allocator_arg, allocator)
12983template <
class t_TYPE>
12984optional<t_TYPE>::optional(bsl::allocator_arg_t,
12985 AllocType allocator,
12986 const optional& original)
12987: BaseType(
bsl::allocator_arg, allocator, original)
12991template <
class t_TYPE>
12992template <
class t_DERIVED>
12993optional<t_TYPE>::optional(bsl::allocator_arg_t,
12994 AllocType allocator,
12997 typename bsl::remove_reference<t_DERIVED>::type))
12998: BaseType(
bsl::allocator_arg_t(),
13000 MoveUtil::move(static_cast<BaseType&>(original)))
13007template <
class t_TYPE>
13008template <
class t_ANY_TYPE>
13009optional<t_TYPE>::optional(
13010 bsl::allocator_arg_t,
13011 AllocType allocator,
13015: BaseType(
bsl::allocator_arg_t(),
13017 BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
13022template <
class t_TYPE>
13023template <
class t_ANY_TYPE>
13024optional<t_TYPE>::optional(
13025 bsl::allocator_arg_t,
13026 AllocType allocator,
13030: BaseType(
bsl::allocator_arg_t(),
13032 BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
13037template <
class t_TYPE>
13038template <
class t_ANY_TYPE>
13039optional<t_TYPE>::optional(
13040 bsl::allocator_arg_t,
13041 AllocType allocator,
13042 const optional<t_ANY_TYPE>& original,
13044 const t_ANY_TYPE&),
13046 const t_ANY_TYPE&))
13047: BaseType(
bsl::allocator_arg_t(),
13049 BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
13054template <
class t_TYPE>
13055template <
class t_ANY_TYPE>
13056optional<t_TYPE>::optional(
13057 bsl::allocator_arg_t,
13058 AllocType allocator,
13059 const optional<t_ANY_TYPE>& original,
13061 const t_ANY_TYPE&),
13063: BaseType(
bsl::allocator_arg_t(),
13065 BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
13070template <
class t_TYPE>
13071template <
class t_ANY_TYPE>
13072optional<t_TYPE>::optional(
13073 bsl::allocator_arg_t,
13074 AllocType allocator,
13078: BaseType(
bsl::allocator_arg_t(),
13080 BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
13082 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
13087template <
class t_TYPE>
13088template <
class t_ANY_TYPE>
13089optional<t_TYPE>::optional(
13090 bsl::allocator_arg_t,
13091 AllocType allocator,
13095: BaseType(
bsl::allocator_arg_t(),
13097 BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
13099 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
13104#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
13105template <
class t_TYPE>
13106template <
class t_ANY_TYPE>
13107optional<t_TYPE>::optional(
13108 bsl::allocator_arg_t,
13109 AllocType allocator,
13110 const std::optional<t_ANY_TYPE>& original,
13112 const t_ANY_TYPE&),
13114 const t_ANY_TYPE&))
13115: BaseType(
bsl::allocator_arg_t(),
13117 BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
13122template <
class t_TYPE>
13123template <
class t_ANY_TYPE>
13124optional<t_TYPE>::optional(
13125 bsl::allocator_arg_t,
13126 AllocType allocator,
13127 const std::optional<t_ANY_TYPE>& original,
13129 const t_ANY_TYPE&),
13131: BaseType(
bsl::allocator_arg_t(),
13133 BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
13138template <
class t_TYPE>
13139template <
class t_ANY_TYPE>
13140optional<t_TYPE>::optional(
13141 bsl::allocator_arg_t,
13142 AllocType allocator,
13143 std::optional<t_ANY_TYPE>&& original,
13146: BaseType(
bsl::allocator_arg_t(),
13148 BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
13149 std::move(original))
13153template <
class t_TYPE>
13154template <
class t_ANY_TYPE>
13155optional<t_TYPE>::optional(
13156 bsl::allocator_arg_t,
13157 AllocType allocator,
13158 std::optional<t_ANY_TYPE>&& original,
13161: BaseType(
bsl::allocator_arg_t(),
13163 BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
13164 std::move(original))
13169#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
13172#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
13173#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
13175#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_T
13176#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_T BSLSTL_OPTIONAL_VARIADIC_LIMIT
13178#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 0
13179template <
class t_TYPE>
13180optional<t_TYPE>::optional(
13181 bsl::allocator_arg_t,
13182 AllocType allocator,
13184: BaseType(
bsl::allocator_arg,
13191#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 1
13192template <
class t_TYPE>
13193template <
class t_ARGS_01>
13194optional<t_TYPE>::optional(
13195 bsl::allocator_arg_t,
13196 AllocType allocator,
13199: BaseType(
bsl::allocator_arg,
13207#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 2
13208template <
class t_TYPE>
13209template <
class t_ARGS_01,
13211optional<t_TYPE>::optional(
13212 bsl::allocator_arg_t,
13213 AllocType allocator,
13217: BaseType(
bsl::allocator_arg,
13226#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 3
13227template <
class t_TYPE>
13228template <
class t_ARGS_01,
13231optional<t_TYPE>::optional(
13232 bsl::allocator_arg_t,
13233 AllocType allocator,
13238: BaseType(
bsl::allocator_arg,
13248#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 4
13249template <
class t_TYPE>
13250template <
class t_ARGS_01,
13254optional<t_TYPE>::optional(
13255 bsl::allocator_arg_t,
13256 AllocType allocator,
13262: BaseType(
bsl::allocator_arg,
13273#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 5
13274template <
class t_TYPE>
13275template <
class t_ARGS_01,
13280optional<t_TYPE>::optional(
13281 bsl::allocator_arg_t,
13282 AllocType allocator,
13289: BaseType(
bsl::allocator_arg,
13301#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 6
13302template <
class t_TYPE>
13303template <
class t_ARGS_01,
13309optional<t_TYPE>::optional(
13310 bsl::allocator_arg_t,
13311 AllocType allocator,
13319: BaseType(
bsl::allocator_arg,
13332#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 7
13333template <
class t_TYPE>
13334template <
class t_ARGS_01,
13341optional<t_TYPE>::optional(
13342 bsl::allocator_arg_t,
13343 AllocType allocator,
13352: BaseType(
bsl::allocator_arg,
13366#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 8
13367template <
class t_TYPE>
13368template <
class t_ARGS_01,
13376optional<t_TYPE>::optional(
13377 bsl::allocator_arg_t,
13378 AllocType allocator,
13388: BaseType(
bsl::allocator_arg,
13403#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 9
13404template <
class t_TYPE>
13405template <
class t_ARGS_01,
13414optional<t_TYPE>::optional(
13415 bsl::allocator_arg_t,
13416 AllocType allocator,
13427: BaseType(
bsl::allocator_arg,
13443#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 10
13444template <
class t_TYPE>
13445template <
class t_ARGS_01,
13455optional<t_TYPE>::optional(
13456 bsl::allocator_arg_t,
13457 AllocType allocator,
13469: BaseType(
bsl::allocator_arg,
13486#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
13487#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 0
13488template <
class t_TYPE>
13489template <
class t_INIT_LIST_TYPE>
13490optional<t_TYPE>::optional(
13491 bsl::allocator_arg_t,
13492 AllocType allocator,
13494 std::initializer_list<t_INIT_LIST_TYPE> il)
13495: BaseType(
bsl::allocator_arg,
13503#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 1
13504template <
class t_TYPE>
13505template <
class t_INIT_LIST_TYPE,
class t_ARGS_01>
13506optional<t_TYPE>::optional(
13507 bsl::allocator_arg_t,
13508 AllocType allocator,
13510 std::initializer_list<t_INIT_LIST_TYPE> il,
13512: BaseType(
bsl::allocator_arg,
13521#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 2
13522template <
class t_TYPE>
13523template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13525optional<t_TYPE>::optional(
13526 bsl::allocator_arg_t,
13527 AllocType allocator,
13529 std::initializer_list<t_INIT_LIST_TYPE> il,
13532: BaseType(
bsl::allocator_arg,
13542#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 3
13543template <
class t_TYPE>
13544template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13547optional<t_TYPE>::optional(
13548 bsl::allocator_arg_t,
13549 AllocType allocator,
13551 std::initializer_list<t_INIT_LIST_TYPE> il,
13555: BaseType(
bsl::allocator_arg,
13566#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 4
13567template <
class t_TYPE>
13568template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13572optional<t_TYPE>::optional(
13573 bsl::allocator_arg_t,
13574 AllocType allocator,
13576 std::initializer_list<t_INIT_LIST_TYPE> il,
13581: BaseType(
bsl::allocator_arg,
13593#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 5
13594template <
class t_TYPE>
13595template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13600optional<t_TYPE>::optional(
13601 bsl::allocator_arg_t,
13602 AllocType allocator,
13604 std::initializer_list<t_INIT_LIST_TYPE> il,
13610: BaseType(
bsl::allocator_arg,
13623#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 6
13624template <
class t_TYPE>
13625template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13631optional<t_TYPE>::optional(
13632 bsl::allocator_arg_t,
13633 AllocType allocator,
13635 std::initializer_list<t_INIT_LIST_TYPE> il,
13642: BaseType(
bsl::allocator_arg,
13656#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 7
13657template <
class t_TYPE>
13658template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13665optional<t_TYPE>::optional(
13666 bsl::allocator_arg_t,
13667 AllocType allocator,
13669 std::initializer_list<t_INIT_LIST_TYPE> il,
13677: BaseType(
bsl::allocator_arg,
13692#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 8
13693template <
class t_TYPE>
13694template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13702optional<t_TYPE>::optional(
13703 bsl::allocator_arg_t,
13704 AllocType allocator,
13706 std::initializer_list<t_INIT_LIST_TYPE> il,
13715: BaseType(
bsl::allocator_arg,
13731#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 9
13732template <
class t_TYPE>
13733template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13742optional<t_TYPE>::optional(
13743 bsl::allocator_arg_t,
13744 AllocType allocator,
13746 std::initializer_list<t_INIT_LIST_TYPE> il,
13756: BaseType(
bsl::allocator_arg,
13773#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_T >= 10
13774template <
class t_TYPE>
13775template <
class t_INIT_LIST_TYPE,
class t_ARGS_01,
13785optional<t_TYPE>::optional(
13786 bsl::allocator_arg_t,
13787 AllocType allocator,
13789 std::initializer_list<t_INIT_LIST_TYPE> il,
13800: BaseType(
bsl::allocator_arg,
13822template <
class t_TYPE>
13823template <
class... t_ARGS>
13824optional<t_TYPE>::optional(
13825 bsl::allocator_arg_t,
13826 AllocType allocator,
13829: BaseType(
bsl::allocator_arg,
13835#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
13836template <
class t_TYPE>
13837template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
13838optional<t_TYPE>::optional(
13839 bsl::allocator_arg_t,
13840 AllocType allocator,
13842 std::initializer_list<t_INIT_LIST_TYPE> il,
13844: BaseType(
bsl::allocator_arg,
13856template <
class t_TYPE>
13864#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
13865template <
class t_TYPE>
13866template <
class t_DERIVED>
13868optional<t_TYPE>::operator=(BloombergLP::bslmf::MovableRef<t_DERIVED> rhs)
13870 BaseType& lvalue = rhs;
13871 BaseType::operator=(MoveUtil::move(lvalue));
13876template <
class t_TYPE>
13877template <
class t_ANY_TYPE>
13879optional<t_TYPE>::operator=(
const optional<t_ANY_TYPE>& rhs)
13881 if (rhs.has_value()) {
13882 this->assignOrEmplace(*rhs);
13889template <
class t_TYPE>
13890template <
class t_ANY_TYPE>
13894 BloombergLP::bslstl::Optional_Base<t_ANY_TYPE>& lvalue = rhs;
13895 if (lvalue.has_value()) {
13896 this->assignOrEmplace(MoveUtil::move(*lvalue));
13903#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
13904template <
class t_TYPE>
13905template <
class t_ANY_TYPE>
13907optional<t_TYPE>::operator=(t_ANY_TYPE&& rhs)
13909 this->assignOrEmplace(std::forward<t_ANY_TYPE>(rhs));
13913template <
class t_TYPE>
13914optional<t_TYPE>& optional<t_TYPE>::operator=(
const t_TYPE& rhs)
13916 this->assignOrEmplace(rhs);
13920template <
class t_TYPE>
13922optional<t_TYPE>::operator=(BloombergLP::bslmf::MovableRef<t_TYPE> rhs)
13924 this->assignOrEmplace(MoveUtil::move(rhs));
13928template <
class t_TYPE>
13929template <
class t_ANY_TYPE>
13931optional<t_TYPE>::operator=(
const t_ANY_TYPE& rhs)
13933 this->assignOrEmplace(rhs);
13937template <
class t_TYPE>
13938template <
class t_ANY_TYPE>
13940optional<t_TYPE>::operator=(BloombergLP::bslmf::MovableRef<t_ANY_TYPE> rhs)
13942 this->assignOrEmplace(MoveUtil::move(rhs));
13947#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
13948template <
class t_TYPE>
13949template <
class t_ANY_TYPE>
13951optional<t_TYPE>::operator=(
const std::optional<t_ANY_TYPE>& rhs)
13953 if (rhs.has_value()) {
13954 this->assignOrEmplace(*rhs);
13961template <
class t_TYPE>
13962template <
class t_ANY_TYPE>
13964optional<t_TYPE>::operator=(std::optional<t_ANY_TYPE>&& rhs)
13966 if (rhs.has_value()) {
13967 this->assignOrEmplace(std::move(*rhs));
13979template <
class t_TYPE>
13985 if (lhs.get_allocator() == rhs.get_allocator()) {
13992 bsl::allocator_arg, lhs.get_allocator(), rhs);
13994 bsl::allocator_arg, rhs.get_allocator(), lhs);
13996 futureLhs.swap(lhs);
13997 futureRhs.swap(rhs);
14000template <
class t_TYPE>
14010template <
class t_HASHALG,
class t_TYPE>
14013 using ::BloombergLP::bslh::hashAppend;
14015 if (input.has_value()) {
14026template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14030 { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14033 if (lhs.has_value() && rhs.has_value()) {
14034 return *lhs == *rhs;
14036 return lhs.has_value() == rhs.has_value();
14039template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14043 { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14046 if (lhs.has_value() && rhs.has_value()) {
14047 return *lhs != *rhs;
14050 return lhs.has_value() != rhs.has_value();
14053template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14057 { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14060 if (!rhs.has_value()) {
14064 return !lhs.has_value() || *lhs < *rhs;
14067template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14071 { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14074 if (!lhs.has_value()) {
14078 return !rhs.has_value() || *lhs > *rhs;
14081template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14085 { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14088 if (!lhs.has_value()) {
14092 return rhs.has_value() && *lhs <= *rhs;
14095template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14099 { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14102 if (!rhs.has_value()) {
14105 return lhs.has_value() && *lhs >= *rhs;
14110template <
class t_TYPE>
14116 return !value.has_value();
14119#if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \
14120 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS))
14121template <
class t_TYPE>
14127 return !value.has_value();
14130template <
class t_TYPE>
14136 return value.has_value();
14139template <
class t_TYPE>
14145 return value.has_value();
14148template <
class t_TYPE>
14157template <
class t_TYPE>
14163 return value.has_value();
14166template <
class t_TYPE>
14172 return value.has_value();
14175template <
class t_TYPE>
14184template <
class t_TYPE>
14190 return !value.has_value();
14193template <
class t_TYPE>
14202template <
class t_TYPE>
14211template <
class t_TYPE>
14217 return !value.has_value();
14224template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14227 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14229 { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14232 return lhs.has_value() && *lhs == rhs;
14235template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14238 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14240 { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14243 return rhs.has_value() && lhs == *rhs;
14246template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14249 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14251 { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14254 return !lhs.has_value() || *lhs != rhs;
14257template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14260 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14262 { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14265 return !rhs.has_value() || lhs != *rhs;
14268template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14271 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14273 { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14276 return !lhs.has_value() || *lhs < rhs;
14279template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14282 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14284 { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14287 return rhs.has_value() && lhs < *rhs;
14290template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14293 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14295 { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14298 return lhs.has_value() && *lhs > rhs;
14301template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14304 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14306 { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14309 return !rhs.has_value() || lhs > *rhs;
14312template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14315 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14317 { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14320 return !lhs.has_value() || *lhs <= rhs;
14323template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14326 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14328 { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14331 return rhs.has_value() && lhs <= *rhs;
14334template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14337 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
14339 { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14342 return lhs.has_value() && *lhs >= rhs;
14345template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14348 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
14350 { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
14353 return !rhs.has_value() || lhs >= *rhs;
14356#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
14357 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
14358template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
14359constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
14363 const bool lhs_has_value = lhs.has_value(),
14364 rhs_has_value = rhs.has_value();
14365 if (lhs_has_value && rhs_has_value) {
14366 return *lhs <=> *rhs;
14368 return lhs_has_value <=> rhs_has_value;
14371template <
class t_LHS,
class t_RHS>
14372requires (!BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS>) &&
14373 three_way_comparable_with<t_LHS, t_RHS>
14374constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
14379 return *lhs <=> rhs;
14381 return strong_ordering::less;
14384template <
class t_TYPE>
14388 return value.has_value() <=>
false;
14391template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
14392constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
14394 const std::optional<t_RHS>& rhs)
14396 const bool lhs_has_value = lhs.has_value(),
14397 rhs_has_value = rhs.has_value();
14398 if (lhs_has_value && rhs_has_value) {
14399 return *lhs <=> *rhs;
14401 return lhs_has_value <=> rhs_has_value;
14406# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
14407template <
class t_TYPE>
14416template <
class t_TYPE>
14427template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14430 const std::optional<t_RHS_TYPE>& rhs)
14432 if (lhs.has_value() && rhs.has_value()) {
14433 return *lhs == *rhs;
14435 return lhs.has_value() == rhs.has_value();
14438template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14440bool operator==(
const std::optional<t_LHS_TYPE>& lhs,
14443 if (lhs.has_value() && rhs.has_value()) {
14444 return *lhs == *rhs;
14446 return lhs.has_value() == rhs.has_value();
14449template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14452 const std::optional<t_RHS_TYPE>& rhs)
14454 if (lhs.has_value() && rhs.has_value()) {
14455 return *lhs != *rhs;
14458 return lhs.has_value() != rhs.has_value();
14461template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14463bool operator!=(
const std::optional<t_LHS_TYPE>& lhs,
14466 if (lhs.has_value() && rhs.has_value()) {
14467 return *lhs != *rhs;
14470 return lhs.has_value() != rhs.has_value();
14473template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14476 const std::optional<t_RHS_TYPE>& rhs)
14478 if (!rhs.has_value()) {
14482 return !lhs.has_value() || *lhs < *rhs;
14485template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14487bool operator<(
const std::optional<t_LHS_TYPE>& lhs,
14490 if (!rhs.has_value()) {
14494 return !lhs.has_value() || *lhs < *rhs;
14497template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14500 const std::optional<t_RHS_TYPE>& rhs)
14502 if (!lhs.has_value()) {
14506 return !rhs.has_value() || *lhs > *rhs;
14509template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14511bool operator>(
const std::optional<t_LHS_TYPE>& lhs,
14514 if (!lhs.has_value()) {
14518 return !rhs.has_value() || *lhs > *rhs;
14521template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14524 const std::optional<t_RHS_TYPE>& rhs)
14526 if (!lhs.has_value()) {
14530 return rhs.has_value() && *lhs <= *rhs;
14533template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14535bool operator<=(
const std::optional<t_LHS_TYPE>& lhs,
14538 if (!lhs.has_value()) {
14542 return rhs.has_value() && *lhs <= *rhs;
14545template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14548 const std::optional<t_RHS_TYPE>& rhs)
14550 if (!rhs.has_value()) {
14553 return lhs.has_value() && *lhs >= *rhs;
14556template <
class t_LHS_TYPE,
class t_RHS_TYPE>
14558bool operator>=(
const std::optional<t_LHS_TYPE>& lhs,
14561 if (!rhs.has_value()) {
14564 return lhs.has_value() && *lhs >= *rhs;
14568template <
class t_TYPE>
14576 bsl::allocator_arg,
14582#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
14585#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
14586#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
14588#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_U
14589#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_U BSLSTL_OPTIONAL_VARIADIC_LIMIT
14591#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 0
14592template <
class t_TYPE>
14594 bsl::allocator_arg_t,
14598 bsl::allocator_arg,
14604#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 1
14605template <
class t_TYPE,
class t_ARGS_01>
14607 bsl::allocator_arg_t,
14612 bsl::allocator_arg,
14619#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 2
14620template <
class t_TYPE,
class t_ARGS_01,
14623 bsl::allocator_arg_t,
14629 bsl::allocator_arg,
14637#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 3
14638template <
class t_TYPE,
class t_ARGS_01,
14642 bsl::allocator_arg_t,
14649 bsl::allocator_arg,
14658#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 4
14659template <
class t_TYPE,
class t_ARGS_01,
14664 bsl::allocator_arg_t,
14672 bsl::allocator_arg,
14682#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 5
14683template <
class t_TYPE,
class t_ARGS_01,
14689 bsl::allocator_arg_t,
14698 bsl::allocator_arg,
14709#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 6
14710template <
class t_TYPE,
class t_ARGS_01,
14717 bsl::allocator_arg_t,
14727 bsl::allocator_arg,
14739#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 7
14740template <
class t_TYPE,
class t_ARGS_01,
14748 bsl::allocator_arg_t,
14759 bsl::allocator_arg,
14772#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 8
14773template <
class t_TYPE,
class t_ARGS_01,
14782 bsl::allocator_arg_t,
14794 bsl::allocator_arg,
14808#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 9
14809template <
class t_TYPE,
class t_ARGS_01,
14819 bsl::allocator_arg_t,
14832 bsl::allocator_arg,
14847#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_U >= 10
14848template <
class t_TYPE,
class t_ARGS_01,
14859 bsl::allocator_arg_t,
14873 bsl::allocator_arg,
14892template <
class t_TYPE,
class... t_ARGS>
14894 bsl::allocator_arg_t,
14899 bsl::allocator_arg,
14907#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
14910#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
14911#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
14913#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_V
14914#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_V BSLSTL_OPTIONAL_VARIADIC_LIMIT
14916# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
14917 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
14918#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 0
14919template <
class t_TYPE,
class t_INIT_LIST_TYPE>
14921 bsl::allocator_arg_t,
14923 std::initializer_list<t_INIT_LIST_TYPE> il)
14926 bsl::allocator_arg,
14933#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 1
14934template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01>
14936 bsl::allocator_arg_t,
14938 std::initializer_list<t_INIT_LIST_TYPE> il,
14942 bsl::allocator_arg,
14950#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 2
14951template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
14954 bsl::allocator_arg_t,
14956 std::initializer_list<t_INIT_LIST_TYPE> il,
14961 bsl::allocator_arg,
14970#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 3
14971template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
14975 bsl::allocator_arg_t,
14977 std::initializer_list<t_INIT_LIST_TYPE> il,
14983 bsl::allocator_arg,
14993#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 4
14994template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
14999 bsl::allocator_arg_t,
15001 std::initializer_list<t_INIT_LIST_TYPE> il,
15008 bsl::allocator_arg,
15019#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 5
15020template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15026 bsl::allocator_arg_t,
15028 std::initializer_list<t_INIT_LIST_TYPE> il,
15036 bsl::allocator_arg,
15048#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 6
15049template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15056 bsl::allocator_arg_t,
15058 std::initializer_list<t_INIT_LIST_TYPE> il,
15067 bsl::allocator_arg,
15080#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 7
15081template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15089 bsl::allocator_arg_t,
15091 std::initializer_list<t_INIT_LIST_TYPE> il,
15101 bsl::allocator_arg,
15115#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 8
15116template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15125 bsl::allocator_arg_t,
15127 std::initializer_list<t_INIT_LIST_TYPE> il,
15138 bsl::allocator_arg,
15153#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 9
15154template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15164 bsl::allocator_arg_t,
15166 std::initializer_list<t_INIT_LIST_TYPE> il,
15178 bsl::allocator_arg,
15194#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_V >= 10
15195template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15206 bsl::allocator_arg_t,
15208 std::initializer_list<t_INIT_LIST_TYPE> il,
15221 bsl::allocator_arg,
15242# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
15243 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
15244template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
15246 bsl::allocator_arg_t,
15248 std::initializer_list<t_INIT_LIST_TYPE> il,
15252 bsl::allocator_arg,
15262template <
class t_TYPE>
15270template <
class t_TYPE>
15276#if BSLS_COMPILERFEATURES_SIMULATE_VARIADIC_TEMPLATES
15279#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT
15280#define BSLSTL_OPTIONAL_VARIADIC_LIMIT 10
15282#ifndef BSLSTL_OPTIONAL_VARIADIC_LIMIT_W
15283#define BSLSTL_OPTIONAL_VARIADIC_LIMIT_W BSLSTL_OPTIONAL_VARIADIC_LIMIT
15285#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0
15286template <
class t_TYPE,
class t_ARG>
15296#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1
15297template <
class t_TYPE,
class t_ARG,
class t_ARGS_01>
15309#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2
15310template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15325#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3
15326template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15344#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4
15345template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15366#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5
15367template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15391#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6
15392template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15419#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7
15420template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15450#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8
15451template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15484#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9
15485template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15521#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10
15522template <
class t_TYPE,
class t_ARG,
class t_ARGS_01,
15562# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
15563 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
15564#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 0
15565template <
class t_TYPE,
class t_INIT_LIST_TYPE>
15567 std::initializer_list<t_INIT_LIST_TYPE> il)
15575#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 1
15576template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01>
15578 std::initializer_list<t_INIT_LIST_TYPE> il,
15588#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 2
15589template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15592 std::initializer_list<t_INIT_LIST_TYPE> il,
15604#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 3
15605template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15609 std::initializer_list<t_INIT_LIST_TYPE> il,
15623#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 4
15624template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15629 std::initializer_list<t_INIT_LIST_TYPE> il,
15645#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 5
15646template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15652 std::initializer_list<t_INIT_LIST_TYPE> il,
15670#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 6
15671template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15678 std::initializer_list<t_INIT_LIST_TYPE> il,
15698#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 7
15699template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15707 std::initializer_list<t_INIT_LIST_TYPE> il,
15729#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 8
15730template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15739 std::initializer_list<t_INIT_LIST_TYPE> il,
15763#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 9
15764template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15774 std::initializer_list<t_INIT_LIST_TYPE> il,
15800#if BSLSTL_OPTIONAL_VARIADIC_LIMIT_W >= 10
15801template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class t_ARGS_01,
15812 std::initializer_list<t_INIT_LIST_TYPE> il,
15844template <
class t_TYPE,
class t_ARG,
class... t_ARGS>
15855# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
15856 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
15857template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
15859 std::initializer_list<t_INIT_LIST_TYPE> il,
15896# if BSLS_COMPILERFEATURES_CPLUSPLUS==202002L && \
15897 defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
15898 (11 <= _GLIBCXX_RELEASE && _GLIBCXX_RELEASE < 14)
15900#define BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_GNU_WORKAROUND_NEEDED
15903template<
typename _Tp>
15904inline constexpr bool __is_optional_v<bsl::optional<_Tp>> =
true;
15909# if BSLS_COMPILERFEATURES_CPLUSPLUS == 202002L && \
15910 defined(BSLS_PLATFORM_CMP_MSVC) && \
15911 (BSLS_PLATFORM_CMP_VERSION >= 1930 && BSLS_PLATFORM_CMP_VERSION < 1936)
15914#define BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_MSVC_WORKAROUND_NEEDED
15917template <
typename _Tp>
15918inline constexpr bool _Is_specialization_v<bsl::optional<_Tp>, std::optional> =
15924#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL
15925#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL
15926#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL
15927#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL
15928#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR
15929#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR
15930#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR
15931#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR
15932#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM
15933#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM
15934#undef BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL
15935#undef BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT
15936#undef BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT
15937#undef BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT
15938#undef BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT
15939#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL
15940#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL
15941#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED
15942#undef BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG
15943#undef BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG
15944#undef BSLSTL_OPTIONAL_REQUIRES
15947# error Not valid except when included from bslstl_optional.h
#define BSLMF_NESTED_TRAIT_DECLARATION(t_TYPE, t_TRAIT)
Definition bslmf_nestedtraitdeclaration.h:231
#define BSLMF_NESTED_TRAIT_DECLARATION_IF(t_TYPE, t_TRAIT, t_COND)
Definition bslmf_nestedtraitdeclaration.h:243
Definition bslma_bslallocator.h:580
decay_imp< U, k_ISARRAY, k_ISFUNC >::type type
Definition bslmf_decay.h:166
Definition bslstl_optional.h:1861
optional() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:4630
optional & operator=(bsl::nullopt_t) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:5031
Definition bslma_allocator.h:457
Optional_Base()
Definition bslstl_optional.h:3125
t_TYPE & emplace(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
Definition bslstl_optional.h:3457
Optional_Base & operator=(const Optional_Base &rhs)
Definition bslstl_optional.h:3583
void assignOrEmplace(BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) rhs)
Definition bslstl_optional.h:3421
t_TYPE & dereferenceRaw()
Definition bslstl_optional.h:3433
allocator_type AllocType
Definition bslstl_optional.h:818
bool has_value() const BSLS_KEYWORD_NOEXCEPT
Return false if this object is disengaged, and true otherwise.
Definition bslstl_optional.h:3675
t_TYPE value_or(BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value) const
Definition bslstl_optional.h:3755
void swap(Optional_Base &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl t_TYPE & value()
Definition bslstl_optional.h:1158
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Return allocator used for construction of value_type.
Definition bslstl_optional.h:3666
t_TYPE & operator*()
Definition bslstl_optional.h:3652
void reset() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:3480
t_TYPE value_type
Definition bslstl_optional.h:812
bsl::allocator< char > allocator_type
Definition bslstl_optional.h:814
t_TYPE * operator->()
Definition bslstl_optional.h:3623
#define BSLMF_MOVABLEREF_DEDUCE(...)
Definition bslmf_movableref.h:690
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_ASSERT_INVOKE_NORETURN(X)
Definition bsls_assert.h:1895
#define BSLS_COMPILERFEATURES_FORWARD_REF(T)
Definition bsls_compilerfeatures.h:2012
#define BSLS_COMPILERFEATURES_FORWARD(T, V)
Definition bsls_compilerfeatures.h:2018
#define BSLS_THROW(X)
Definition bsls_exceptionutil.h:374
#define BSLS_NOTHROW_SPEC
Definition bsls_exceptionutil.h:386
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_DELETED
Definition bsls_keyword.h:609
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(...)
Definition bsls_keyword.h:634
#define BSLS_UTIL_ADDRESSOF(OBJ)
Definition bsls_util.h:289
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:381
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:295
#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
Definition bslstl_optional.h:351
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, ANY_TYPE)
Definition bslstl_optional.h:321
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:389
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( TYPE, ANY_TYPE)
Definition bslstl_optional.h:327
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE)
Definition bslstl_optional.h:340
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:287
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
Definition bslstl_optional.h:371
#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG)
Definition bslstl_optional.h:426
#define BSLSTL_OPTIONAL_REQUIRES(EXPR)
Definition bslstl_optional.h:442
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE)
Definition bslstl_optional.h:346
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:308
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(TYPE, ANY_TYPE)
Definition bslstl_optional.h:417
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, ANY_TYPE)
Definition bslstl_optional.h:314
#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
Definition bslstl_optional.h:357
#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(U, V)
Definition bslstl_optional.h:366
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
Definition bslstl_optional.h:301
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE)
Definition bslstl_optional.h:406
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
Definition bslstl_optional.h:376
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( TYPE, ANY_TYPE)
Definition bslstl_optional.h:334
#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT(U, V)
Definition bslstl_optional.h:361
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(TYPE, DERIVED)
Definition bslstl_optional.h:398
bool operator!=(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
bool operator==(const FileCleanerConfiguration &lhs, const FileCleanerConfiguration &rhs)
void swap(OptionValue &a, OptionValue &b)
void hashAppend(HASH_ALGORITHM &hashAlg, const baljsn::EncoderTestAddress &object)
Definition baljsn_encoder_testtypes.h:9236
bool operator<(const MetricId &lhs, const MetricId &rhs)
void reset(TYPE *object)
Reset the value of the specified object to its default value.
bool operator>=(const Guid &lhs, const Guid &rhs)
bool operator<=(const Guid &lhs, const Guid &rhs)
bool operator>(const Guid &lhs, const Guid &rhs)
Decimal32 operator*(Decimal32 lhs, Decimal32 rhs)
Definition bdlb_printmethods.h:283
bool operator==(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator==(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator!=(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator!=(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator<(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator<(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator>(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator>(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator<=(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator<=(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator>=(const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP bool operator>=(const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP BSLS_KEYWORD_CONSTEXPR bsl::optional< typename bsl::decay< t_TYPE >::type > make_optional(bsl::allocator_arg_t, const typename bsl::optional< typename bsl::decay< t_TYPE >::type >::allocator_type &alloc, BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs)
Definition bslstl_optional.h:2881
void hashAppend(HASH_ALGORITHM &hashAlgorithm, const array< TYPE, SIZE > &input)
Pass the specified input to the specified hashAlgorithm
Definition bslstl_array.h:950
const in_place_t in_place
Definition balxml_encoderoptions.h:68
Definition bslstl_algorithm.h:82
Definition bdldfp_decimal.h:5188
Definition bslmf_enableif.h:525
Definition bslstl_inplace.h:99
Definition bslmf_integralconstant.h:244
Definition bslmf_isnothrowmoveconstructible.h:358
Definition bslstl_optional.h:467
BSLS_KEYWORD_CONSTEXPR nullopt_t(t_TYPE, typename enable_if< is_same< t_TYPE, BloombergLP::bslstl::Optional_NulloptConstructToken >::value, int >::type=0) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:475
t_TYPE type
This typedef is an alias to the (template parameter) t_TYPE.
Definition bslmf_removeconst.h:161
Definition bslmf_isbitwisecopyable.h:298
t_TYPE & emplace(bslma::Allocator *allocator, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
Definition bslstl_optional.h:2989
Optional_DataImp() BSLS_KEYWORD_NOEXCEPT
Create an empty Optional_DataImp object.
Definition bslstl_optional.h:2979
bool hasValue() const BSLS_KEYWORD_NOEXCEPT
Return true if this objects has a value, and false otherwise.
Definition bslstl_optional.h:3066
t_TYPE & value()
Definition bslstl_optional.h:3054
void reset() BSLS_KEYWORD_NOEXCEPT
Destroy the value_type object in d_buffer, if any.
Definition bslstl_optional.h:3023
~Optional_Data()
Destroy the managed value_type object, if it exists.
Definition bslstl_optional.h:3109
Definition bslstl_optional.h:521
BSLS_KEYWORD_CONSTEXPR Optional_OptNoSuchType(int) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:563
Definition bsls_objectbuffer.h:276
TYPE * address()
Definition bsls_objectbuffer.h:334
TYPE & object()
Definition bsls_objectbuffer.h:351