9#ifndef INCLUDED_BSLSTL_OPTIONAL
10#define INCLUDED_BSLSTL_OPTIONAL
131#include <bslscm_version.h>
174#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
178#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
179# include <type_traits>
182#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
187#ifdef BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS
188# include <initializer_list>
191#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
195# define COMPILING_BSLSTL_OPTIONAL_H
197# undef COMPILING_BSLSTL_OPTIONAL_H
204# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
211#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT) \
212 std::is_constructible<U, V>::value
217#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT) \
218 std::is_assignable<U, V>::value
222#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT) DEFAULT
224#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT) DEFAULT
231#define BSLSTL_OPTIONAL_CONVERTS_FROM(TYPE, OPT_TYPE) \
232 (bsl::is_convertible<const OPT_TYPE&, TYPE>::value || \
233 bsl::is_convertible<OPT_TYPE&, TYPE>::value || \
234 bsl::is_convertible<const OPT_TYPE, TYPE>::value || \
235 bsl::is_convertible<OPT_TYPE, TYPE>::value || \
236 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, const OPT_TYPE&, false) || \
237 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, OPT_TYPE&, false) || \
238 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, const OPT_TYPE, false) || \
239 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, OPT_TYPE, false))
244# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
245#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE) \
246 (std::is_assignable<TYPE&, const OPT_TYPE&>::value || \
247 std::is_assignable<TYPE&, OPT_TYPE&>::value || \
248 std::is_assignable<TYPE&, const OPT_TYPE>::value || \
249 std::is_assignable<TYPE&, OPT_TYPE>::value)
254#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE) false
257#define BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
258 BSLSTL_OPTIONAL_CONVERTS_FROM( \
260 bsl::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
262#define BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
263 BSLSTL_OPTIONAL_ASSIGNS_FROM( \
265 bsl::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
267# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
268#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
269 BSLSTL_OPTIONAL_CONVERTS_FROM( \
271 std::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
273#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
274 BSLSTL_OPTIONAL_ASSIGNS_FROM( \
276 std::optional<typename bsl::remove_cvref<ANY_TYPE>::type>)
280#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) false
281#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) false
287#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, \
289 typename bsl::enable_if< \
290 !bsl::is_same<TYPE, ANY_TYPE>::value && \
291 !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) && \
292 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true), \
293 BloombergLP::bslstl::Optional_OptNoSuchType>::type
295#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, \
297 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL( \
299 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
301#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, \
303 typename bsl::enable_if< \
304 !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) && \
305 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true), \
306 BloombergLP::bslstl::Optional_OptNoSuchType>::type
308#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, \
310 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL( \
312 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
314#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, \
316 typename bsl::enable_if< \
317 BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE, \
319 BloombergLP::bslstl::Optional_OptNoSuchType>::type
321#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, \
323 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR( \
325 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
327#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
329 typename bsl::enable_if< \
330 !BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE, \
332 BloombergLP::bslstl::Optional_OptNoSuchType>::type
334#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
336 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( \
338 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
340#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE) \
341 typename bsl::enable_if< \
342 BloombergLP::bslstl::Optional_ConstructsFromType<TYPE, \
344 BloombergLP::bslstl::Optional_OptNoSuchType>::type
346#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE) \
347 BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM( \
349 ANY_TYPE) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
351#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED) \
352 typename bsl::enable_if< \
353 BloombergLP::bslmf::IsAccessibleBaseOf<optional, DERIVED>::value && \
354 !bsl::is_const<DERIVED>::value, \
355 BloombergLP::bslstl::Optional_OptNoSuchType>::type
357#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(DERIVED) \
358 BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED) = \
359 BloombergLP::bslstl::Optional_OptNoSuchType(0)
361#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT(U, V) \
362 typename bsl::enable_if< \
363 !bsl::is_convertible<V, U>::value, \
364 BloombergLP::bslstl::Optional_OptNoSuchType>::type
366#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(U, V) \
367 BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT( \
369 V) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
371#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT(U, V) \
372 typename bsl::enable_if< \
373 bsl::is_convertible<V, U>::value, \
374 BloombergLP::bslstl::Optional_OptNoSuchType>::type
376#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(U, V) \
377 BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT( \
379 V) = BloombergLP::bslstl::Optional_OptNoSuchType(0)
381#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) \
382 typename bsl::enable_if< \
383 !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) && \
384 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) && \
385 BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) && \
386 !BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE), \
387 optional<TYPE> >::type
389#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) \
390 typename bsl::enable_if< \
391 !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) && \
392 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) && \
393 BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) && \
394 !BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE), \
395 optional<TYPE> >::type
397# if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
398# define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(TYPE, DERIVED) \
399 typename bsl::enable_if< \
400 BloombergLP::bslmf::IsAccessibleBaseOf<bsl::optional<TYPE>, \
402 !bsl::is_same<bsl::optional<TYPE>, DERIVED>::value, \
403 optional<TYPE> >::type
406#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE) \
407 typename bsl::enable_if< \
408 !bsl::is_same<bsl::optional<TYPE>, \
409 typename bsl::remove_cvref<ANY_TYPE>::type>::value && \
410 !(bsl::is_same<TYPE, \
411 typename bsl::decay<ANY_TYPE>::type>::value && \
412 std::is_scalar<TYPE>::value) && \
413 std::is_constructible<TYPE, ANY_TYPE>::value && \
414 std::is_assignable<TYPE, ANY_TYPE>::value, \
415 optional<TYPE> >::type
417#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(TYPE, ANY_TYPE) \
418 typename bsl::enable_if< \
419 !::BloombergLP::bslmf::IsAccessibleBaseOf< \
420 bsl::optional<TYPE>, \
421 typename bsl::remove_cv< \
422 typename ::BloombergLP::bslmf::MovableRefUtil:: \
423 RemoveReference<ANY_TYPE>::type>::type>::value, \
424 optional<TYPE> >::type
426#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG) \
427 typename bsl::enable_if< \
429 typename bsl::remove_cvref<ARG>::type, \
430 bsl::allocator_arg_t>::value, \
431 optional<t_TYPE> >::type
433#ifdef BSLS_COMPILERFEATURES_SUPPORT_DEFAULT_TEMPLATE_ARGS
434 #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG) = ARG
436 #define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG)
439#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
440 #define BSLSTL_OPTIONAL_REQUIRES(EXPR) requires(EXPR)
442 #define BSLSTL_OPTIONAL_REQUIRES(EXPR)
456# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
458using nullopt_t = std::nullopt_t;
474 template <
class t_TYPE>
478 BloombergLP::bslstl::
479 Optional_NulloptConstructToken>::value,
486# if defined(BSLS_COMPILERFEATURES_SUPPORT_INLINE_VARIABLES)
488nullopt_t
nullopt(BloombergLP::bslstl::Optional_NulloptConstructToken{});
497template <
class t_TYPE>
513# ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
519template <
class t_TYPE>
521: std::is_trivially_destructible<t_TYPE> {
526template <
class t_TYPE>
578template <
class t_TYPE,
class t_ANY_TYPE>
582 bslma::UsesBslmaAllocator<t_TYPE>::value &&
583 bsl::is_const<t_TYPE>::value &&
584 bsl::is_same<t_ANY_TYPE,
585 typename bsl::remove_cv<t_TYPE>::type>::value> {
591template <
class t_TYPE,
class t_ANY_TYPE>
595 !bslmf::IsAccessibleBaseOf<
596 bsl::optional<t_TYPE>,
597 typename bsl::remove_cvref<t_ANY_TYPE>::type>::value &&
598 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
599 bsl::nullopt_t>::value &&
600 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
601 bsl::in_place_t>::value &&
602 !bsl::is_same<typename bsl::remove_cvref<t_ANY_TYPE>::type,
603 bsl::allocator_arg_t>::value &&
604 BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(t_TYPE, t_ANY_TYPE, true)> {
634template <
class t_TYPE>
656#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
660 template <
class... t_ARGS>
664# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
668 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
671 std::initializer_list<t_INIT_LIST_TYPE> initializer_list,
679# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
697# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
701 const t_TYPE&
value()
const &;
702 const t_TYPE&&
value()
const &&;
705 const t_TYPE&
value()
const;
722 bool t_IS_TRIVIALLY_DESTRUCTIBLE =
740template <
class t_TYPE>
753#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
754template <
class t_TYPE>
757template <
class t_TYPE>
758void optional_acceptsStdOptional(
const std::optional<t_TYPE>&);
760template <
class t_TYPE>
761concept Optional_ConvertibleToBool =
764 bsl::is_convertible_v<t_TYPE, bool>;
766template <
class t_TYPE>
767concept Optional_DerivedFromBslOptional =
770 requires (
const t_TYPE& t) { optional_acceptsBslOptional(t); };
772template <
class t_TYPE>
773concept Optional_DerivedFromStdOptional =
776 requires (
const t_TYPE& t) { optional_acceptsStdOptional(t); };
778template <
class t_TYPE>
779concept Optional_DerivedFromOptional =
782 Optional_DerivedFromBslOptional<t_TYPE> ||
783 Optional_DerivedFromStdOptional<t_TYPE>;
800template <
class t_TYPE,
801 bool t_USES_BSLMA_ALLOC =
802 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
822 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
824# ifndef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
831 typedef BloombergLP::bsls::UnspecifiedBool<Optional_Base>
833 typedef typename UnspecifiedBoolUtil::BoolType UnspecifiedBool;
839 BloombergLP::bslstl::Optional_Data<t_TYPE> d_value;
860 Optional_Base(BloombergLP::bslmf::MovableRef<Optional_Base> original)
872 template <
class t_ANY_TYPE>
880 template <
class t_ANY_TYPE>
881 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
889 template <
class t_ANY_TYPE>
891 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
903 template <
class t_ANY_TYPE>
905 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
910# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
915 template <
class t_ANY_TYPE>
916 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
917 const std::optional<t_ANY_TYPE>& original);
923 template <
class t_ANY_TYPE>
924 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
925 std::optional<t_ANY_TYPE>&& original);
928#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
932 template <
class... t_ARGS>
935# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
940 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
942 std::initializer_list<t_INIT_LIST_TYPE> il,
974 BloombergLP::bslmf::MovableRef<Optional_Base> original);
979 template <
class t_ANY_TYPE>
982 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
989 template <
class t_ANY_TYPE>
992 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1001 template <
class t_ANY_TYPE>
1004 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1007# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1013 template <
class t_ANY_TYPE>
1016 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
1017 const std::optional<t_ANY_TYPE>& original);
1025 template <
class t_ANY_TYPE>
1028 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
1029 std::optional<t_ANY_TYPE>&& original);
1032#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1036 template <
class... t_ARGS>
1042# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1046 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1050 std::initializer_list<t_INIT_LIST_TYPE> il,
1061 template <
class t_ANY_TYPE>
1064# ifndef BDE_OMIT_INTERNAL_DEPRECATED
1089 BloombergLP::bslma::UsesBslmaAllocator);
1091 BloombergLP::bslmf::UsesAllocatorArgT);
1094 BloombergLP::bslmf::IsBitwiseMoveable,
1095 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
1098 BloombergLP::bslmf::IsBitwiseCopyable,
1099 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
1102#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1114 template <
class... t_ARGS>
1117# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1130 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1131 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
1141 bsl::is_nothrow_move_constructible<t_TYPE>::
value &&
1142 bsl::is_nothrow_swappable<t_TYPE>::
value);
1151# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1156 t_TYPE&&
value() &&;
1164# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1169 template <
class t_ANY_TYPE>
1171# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
1177 template <
class t_ANY_TYPE>
1178 t_TYPE
value_or(bsl::allocator_arg_t,
1180 t_ANY_TYPE&&
value) &&;
1194 BloombergLP::bslmf::MovableRef<Optional_Base> rhs);
1201# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1223# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1227 const t_TYPE&
value() const &;
1228 const t_TYPE&&
value() const &&;
1243# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1249 const t_TYPE&& operator*() const &&;
1260# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1265 template <
class t_ANY_TYPE>
1268# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
1274 template <
class t_ANY_TYPE>
1276 bsl::allocator_arg_t,
1281 template <
class t_ANY_TYPE>
1287# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
1288 template <
class t_ANY_TYPE>
1289 t_TYPE
value_or(bsl::allocator_arg_t,
1300#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
1308 return UnspecifiedBoolUtil::makeValue(
has_value());
1321# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1324template <
class t_TYPE>
1325class Optional_Base<t_TYPE, false> :
public std::optional<t_TYPE> {
1329 typedef std::optional<t_TYPE> StdOptionalBase;
1351 template <
class t_ANY_TYPE>
1352 Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef,
1353 t_ANY_TYPE&&
value);
1359 template <
class t_ANY_TYPE>
1360 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1361 const Optional_Base<t_ANY_TYPE>& original);
1368 template <
class t_ANY_TYPE>
1369 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1370 Optional_Base<t_ANY_TYPE>&& original);
1372 template <
class t_ANY_TYPE>
1373 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
1374 const std::optional<t_ANY_TYPE>& original);
1376 template <
class t_ANY_TYPE>
1377 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
1378 std::optional<t_ANY_TYPE>&& original);
1382 template <
class... t_ARGS>
1387 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1389 std::initializer_list<t_INIT_LIST_TYPE> il,
1400 template <
class t_ANY_TYPE>
1403 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
1406 template <
class t_ANY_TYPE>
1409 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1410 const Optional_Base<t_ANY_TYPE>&);
1412 template <
class t_ANY_TYPE>
1415 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1416 Optional_Base<t_ANY_TYPE>&&);
1418 template <
class t_ANY_TYPE>
1421 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
1422 const std::optional<t_ANY_TYPE>&);
1424 template <
class t_ANY_TYPE>
1427 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
1428 std::optional<t_ANY_TYPE>&&);
1430 template <
class... t_ARGS>
1436 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1440 std::initializer_list<t_INIT_LIST_TYPE>,
1448 template <
class t_ANY_TYPE>
1451# ifndef BDE_OMIT_INTERNAL_DEPRECATED
1477 BloombergLP::bslmf::IsBitwiseMoveable,
1478 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
1481 BloombergLP::bslmf::IsBitwiseCopyable,
1482 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
1494template <
class t_TYPE>
1501 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1503# ifndef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
1510 typedef BloombergLP::bsls::UnspecifiedBool<Optional_Base>
1511 UnspecifiedBoolUtil;
1512 typedef typename UnspecifiedBoolUtil::BoolType UnspecifiedBool;
1516 BloombergLP::bslstl::Optional_Data<t_TYPE> d_value;
1539 Optional_Base(BloombergLP::bslmf::MovableRef<Optional_Base> original)
1547 template <
class t_ANY_TYPE>
1553 template <
class t_ANY_TYPE>
1554 Optional_Base(BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1560 template <
class t_ANY_TYPE>
1561 Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1568#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1569 template <
class... t_ARGS>
1576# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1577 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1579 std::initializer_list<t_INIT_LIST_TYPE> il,
1598 BloombergLP::bslmf::MovableRef<Optional_Base>);
1600 template <
class t_ANY_TYPE>
1603 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
1606 template <
class t_ANY_TYPE>
1609 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
1612 template <
class t_ANY_TYPE>
1615 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
1618#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1619 template <
class... t_ARGS>
1625# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1626 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1630 std::initializer_list<t_INIT_LIST_TYPE>,
1636 template <
class t_ANY_TYPE>
1642# ifndef BDE_OMIT_INTERNAL_DEPRECATED
1674 BloombergLP::bslmf::IsBitwiseMoveable,
1675 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
1678 BloombergLP::bslmf::IsBitwiseCopyable,
1679 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
1682#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1683 template <
class... t_ARGS>
1693# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
1694 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
1695 t_TYPE&
emplace(std::initializer_list<t_INIT_LIST_TYPE> il,
1714 bsl::is_nothrow_move_constructible<t_TYPE>::
value &&
1715 bsl::is_nothrow_swappable<t_TYPE>::
value);
1722# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1724 t_TYPE&&
value() &&;
1737# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1738 template <
class t_ANY_TYPE>
1751 BloombergLP::bslmf::MovableRef<Optional_Base> rhs);
1763# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1784# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1785 const t_TYPE&
value() const &;
1786 const t_TYPE&&
value() const &&;
1798# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1799 template <
class t_ANY_TYPE>
1807 template <
class t_ANY_TYPE>
1820# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
1822 const t_TYPE&& operator*() const&&;
1833#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
1841 return UnspecifiedBoolUtil::makeValue(
has_value());
1860template <
class t_TYPE>
1861class optional :
public BloombergLP::bslstl::Optional_Base<t_TYPE> {
1864 typedef BloombergLP::bslstl::Optional_Base<t_TYPE> BaseType;
1866 typedef typename BaseType::AllocType AllocType;
1868 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1874 BloombergLP::bslma::UsesBslmaAllocator,
1875 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value);
1878 BloombergLP::bslmf::UsesAllocatorArgT,
1879 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value);
1882 BloombergLP::bslmf::IsBitwiseMoveable,
1883 BloombergLP::bslmf::IsBitwiseMoveable<t_TYPE>::value);
1886 BloombergLP::bslmf::IsBitwiseCopyable,
1887 BloombergLP::bslmf::IsBitwiseCopyable<t_TYPE>::value);
1899#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
1900 template <
class t_DERIVED>
1901 optional(BloombergLP::bslmf::MovableRef<t_DERIVED> original,
1918 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
1931 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
1937 template <
class t_ANY_TYPE>
1944 const t_ANY_TYPE&));
1955 template <
class t_ANY_TYPE>
1962 const t_ANY_TYPE&));
1964 template <
class t_ANY_TYPE>
1982 template <
class t_ANY_TYPE>
1989# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1990 template <
class t_ANY_TYPE>
1992 const std::optional<t_ANY_TYPE>& original,
2008 template <
class t_ANY_TYPE>
2010 const std::optional<t_ANY_TYPE>& original,
2016 template <
class t_ANY_TYPE>
2018 std::optional<t_ANY_TYPE>&& original,
2032 template <
class t_ANY_TYPE>
2034 std::optional<t_ANY_TYPE>&& original,
2040#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2044 template <
class... t_ARGS>
2048# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2053 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
2055 std::initializer_list<t_INIT_LIST_TYPE> il,
2088 template <
class t_DERIVED>
2093 typename bsl::remove_reference<t_DERIVED>::type));
2101 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
2108 template <
class t_ANY_TYPE BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(t_TYPE)>
2110 bsl::allocator_arg_t,
2124 template <
class t_ANY_TYPE>
2126 bsl::allocator_arg_t,
2133 const t_ANY_TYPE&));
2134 template <
class t_ANY_TYPE>
2136 bsl::allocator_arg_t,
2143 const t_ANY_TYPE&));
2154 template <
class t_ANY_TYPE>
2156 bsl::allocator_arg_t,
2162 template <
class t_ANY_TYPE>
2164 bsl::allocator_arg_t,
2171# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2180 template <
class t_ANY_TYPE>
2182 bsl::allocator_arg_t,
2184 const std::optional<t_ANY_TYPE>& original,
2189 const t_ANY_TYPE&));
2190 template <
class t_ANY_TYPE>
2192 bsl::allocator_arg_t,
2194 const std::optional<t_ANY_TYPE>& original,
2210 template <
class t_ANY_TYPE>
2212 bsl::allocator_arg_t,
2214 std::optional<t_ANY_TYPE>&& original,
2218 template <
class t_ANY_TYPE>
2220 bsl::allocator_arg_t,
2222 std::optional<t_ANY_TYPE>&& original,
2228#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2232 template <
class... t_ARGS>
2238# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
2242 template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
2243 explicit optional(bsl::allocator_arg_t,
2246 std::initializer_list<t_INIT_LIST_TYPE> il,
2261#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
2262 template <
class t_DERIVED>
2264 operator=(BloombergLP::bslmf::MovableRef<t_DERIVED> rhs);
2282 template <
class t_ANY_TYPE>
2292 template <
class t_ANY_TYPE>
2296#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
2307 template <
class t_ANY_TYPE = t_TYPE>
2325 template <
class t_ANY_TYPE>
2334 template <
class t_ANY_TYPE>
2336 operator=(BloombergLP::bslmf::MovableRef<t_ANY_TYPE> rhs);
2339#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2346 template <
class t_ANY_TYPE = t_TYPE>
2348 operator=(
const std::optional<t_ANY_TYPE>& rhs);
2356 template <
class t_ANY_TYPE = t_TYPE>
2358 operator=(std::optional<t_ANY_TYPE>&& rhs);
2371template <
class t_TYPE>
2376template <
class t_TYPE>
2390# ifdef BSLS_COMPILERFEATURES_SUPPORT_CTAD
2395template <
class t_TYPE>
2396optional(t_TYPE) -> optional<t_TYPE>;
2403template <
class t_TYPE,
2405 class =
typename bsl::enable_if_t<
2406 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>,
2407 class =
typename bsl::enable_if_t<
2408 bsl::is_convertible_v<t_ALLOC, bsl::allocator<char>>>
2410optional(bsl::allocator_arg_t, t_ALLOC, t_TYPE)
2418template <
class t_TYPE,
2420 class =
typename bsl::enable_if_t<
2421 BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>,
2422 class =
typename bsl::enable_if_t<
2423 bsl::is_convertible_v<t_ALLOC, bsl::allocator<char>>>
2425optional(bsl::allocator_arg_t, t_ALLOC, optional<t_TYPE>)
2439template <
class t_TYPE>
2448template <
class t_TYPE>
2457template <
class t_HASHALG,
class t_TYPE>
2458void hashAppend(t_HASHALG& hashAlg,
const optional<t_TYPE>& input);
2461template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2465 { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2472template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2476 { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2484template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2488 { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2495template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2499 { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2506template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2510 { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2516template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2520 { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2528template <
class t_TYPE>
2532#if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \
2533 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS))
2534template <
class t_TYPE>
2542template <
class t_TYPE>
2546template <
class t_TYPE>
2554template <
class t_TYPE>
2561template <
class t_TYPE>
2569template <
class t_TYPE>
2576template <
class t_TYPE>
2583template <
class t_TYPE>
2590template <
class t_TYPE>
2597template <
class t_TYPE>
2604template <
class t_TYPE>
2615template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2617 const t_RHS_TYPE& rhs)
2619 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2621 { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2623template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2627 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2629 { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2636template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2638 const t_RHS_TYPE& rhs)
2640 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2642 { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2644template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2648 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2650 { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2658template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2661 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2663 { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2669template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2672 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2674 { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2680template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2683 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2685 { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2691template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2694 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2696 { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2702template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2705 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2707 { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2713template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2716 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2718 { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2724template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2727 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
2729 { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2735template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2738 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
2740 { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
2746#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
2747 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
2751template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
2752constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
2759template <
class t_LHS,
class t_RHS>
2760requires (!BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS>) &&
2761 three_way_comparable_with<t_LHS, t_RHS>
2762constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
2768template <
class t_TYPE>
2769constexpr strong_ordering operator<=>(
2776template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
2777constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
2779 const std::optional<t_RHS>& rhs);
2782# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
2787template <
class t_TYPE>
2791template <
class t_TYPE>
2803template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2804bool operator==(
const std::optional<t_LHS_TYPE>& lhs,
2806template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2808 const std::optional<t_RHS_TYPE>& rhs);
2816template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2818 const std::optional<t_RHS_TYPE>& rhs);
2819template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2820bool operator!=(
const std::optional<t_LHS_TYPE>& lhs,
2829template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2831 const std::optional<t_RHS_TYPE>& rhs);
2832template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2833bool operator<(
const std::optional<t_LHS_TYPE>& lhs,
2842template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2844 const std::optional<t_RHS_TYPE>& rhs);
2845template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2846bool operator>(
const std::optional<t_LHS_TYPE>& lhs,
2854template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2856 const std::optional<t_RHS_TYPE>& rhs);
2857template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2858bool operator<=(
const std::optional<t_LHS_TYPE>& lhs,
2866template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2868 const std::optional<t_RHS_TYPE>& rhs);
2869template <
class t_LHS_TYPE,
class t_RHS_TYPE>
2870bool operator>=(
const std::optional<t_LHS_TYPE>& lhs,
2879template <
class t_TYPE>
2886#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2892template <
class t_TYPE,
class... t_ARGS>
2894 bsl::allocator_arg_t,
2898# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
2899 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
2909template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
2911 bsl::allocator_arg_t,
2913 std::initializer_list<t_INIT_LIST_TYPE> il,
2922template <
class t_TYPE>
2929template <
class t_TYPE>
2932#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2937template <
class t_TYPE,
class t_ARG,
class... t_ARGS>
2942# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
2943 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
2952template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
2954 std::initializer_list<t_INIT_LIST_TYPE> il,
2978template <
class t_TYPE>
2985#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2986template <
class t_TYPE>
2987template <
class... t_ARGS>
2994 BloombergLP::bslma::ConstructionUtil::construct(
2999 return d_buffer.object();
3002# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3003template <
class t_TYPE>
3004template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3007 std::initializer_list<t_INIT_LIST_TYPE> il,
3011 BloombergLP::bslma::ConstructionUtil::construct(
3017 return d_buffer.object();
3022template <
class t_TYPE>
3027 bslma::DestructionUtil::destroy(d_buffer.address());
3031# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3032template <
class t_TYPE>
3039 return d_buffer.object();
3042template <
class t_TYPE>
3049 return std::move(d_buffer.object());
3052template <
class t_TYPE>
3059 return d_buffer.object();
3064template <
class t_TYPE>
3071# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3072template <
class t_TYPE>
3079 return d_buffer.object();
3082template <
class t_TYPE>
3089 return std::move(d_buffer.object());
3092template <
class t_TYPE>
3099 return d_buffer.object();
3108template <
class t_TYPE,
bool t_IS_TRIVIALLY_DESTRUCTIBLE>
3123template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3129template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3135template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3140 if (original.has_value()) {
3145template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3148 BloombergLP::bslmf::MovableRef<Optional_Base> original)
3151: d_allocator(MoveUtil::access(original).get_allocator())
3155 if (lvalue.has_value()) {
3156 emplace(MoveUtil::move(*lvalue));
3160template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3161template <
class t_ANY_TYPE>
3164 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
3170template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3171template <
class t_ANY_TYPE>
3174 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
3177 if (original.has_value()) {
3178 emplace(original.value());
3182template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3183template <
class t_ANY_TYPE>
3186 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3192 if (lvalue.has_value()) {
3193 emplace(MoveUtil::move(*lvalue));
3197template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3198template <
class t_ANY_TYPE>
3201 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3205: d_allocator(MoveUtil::access(original).get_allocator())
3208 if (lvalue.has_value()) {
3209 emplace(MoveUtil::move(*lvalue));
3213# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3214template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3215template <
class t_ANY_TYPE>
3218 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
3219 const std::optional<t_ANY_TYPE>& original)
3221 if (original.has_value()) {
3222 emplace(original.value());
3226template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3227template <
class t_ANY_TYPE>
3230 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
3231 std::optional<t_ANY_TYPE>&& original)
3233 if (original.has_value()) {
3234 emplace(std::move(original.value()));
3239#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3240template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3241template <
class... t_ARGS>
3250# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3251template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3252template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3256 std::initializer_list<t_INIT_LIST_TYPE> il,
3264template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3267 bsl::allocator_arg_t,
3269: d_allocator(allocator)
3273template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3276 bsl::allocator_arg_t,
3279: d_allocator(allocator)
3283template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3286 bsl::allocator_arg_t,
3289: d_allocator(allocator)
3291 if (original.has_value()) {
3296template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3299 bsl::allocator_arg_t,
3301 BloombergLP::bslmf::MovableRef<Optional_Base> original)
3302: d_allocator(allocator)
3306 if (lvalue.has_value()) {
3307 emplace(MoveUtil::move(*lvalue));
3311template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3312template <
class t_ANY_TYPE>
3315 bsl::allocator_arg_t,
3317 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
3319: d_allocator(allocator)
3324template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3325template <
class t_ANY_TYPE>
3328 bsl::allocator_arg_t,
3330 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
3332: d_allocator(allocator)
3334 if (original.has_value()) {
3339template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3340template <
class t_ANY_TYPE>
3343 bsl::allocator_arg_t,
3345 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3347: d_allocator(allocator)
3350 if (lvalue.has_value()) {
3351 emplace(MoveUtil::move(*lvalue));
3355# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3356template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3357template <
class t_ANY_TYPE>
3360 bsl::allocator_arg_t,
3361 allocator_type allocator,
3362 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
3363 const std::optional<t_ANY_TYPE>& original)
3364: d_allocator(allocator)
3366 if (original.has_value()) {
3371template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3372template <
class t_ANY_TYPE>
3375 bsl::allocator_arg_t,
3376 allocator_type allocator,
3377 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
3378 std::optional<t_ANY_TYPE>&& original)
3379: d_allocator(allocator)
3381 if (original.has_value()) {
3382 emplace(std::move(original.value()));
3387#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3388template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3389template <
class... t_ARGS>
3392 bsl::allocator_arg_t,
3401# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3402template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3403template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3406 bsl::allocator_arg_t,
3407 allocator_type alloc,
3409 std::initializer_list<t_INIT_LIST_TYPE> il,
3419template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3420template <
class t_ANY_TYPE>
3431# ifndef BDE_OMIT_INTERNAL_DEPRECATED
3432template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3438 return d_value.value();
3442template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3448 return d_value.value();
3453#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3454template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3455template <
class... t_ARGS>
3460 return d_value.emplace(d_allocator.
mechanism(),
3464# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
3465template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3466template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3468 std::initializer_list<t_INIT_LIST_TYPE> il,
3471 return d_value.emplace(d_allocator.
mechanism(),
3478template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3485template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3489 bsl::is_nothrow_swappable<t_TYPE>::value)
3493 if (this->has_value() && other.has_value()) {
3494 BloombergLP::bslalg::SwapUtil::swap(
3498 else if (this->has_value()) {
3499 other.emplace(MoveUtil::move(d_value.value()));
3502 else if (other.has_value()) {
3503 this->emplace(MoveUtil::move(*other));
3508# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3509template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3516 return d_value.value();
3519template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3526 return std::move(d_value.value());
3530template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3537 return d_value.value();
3542# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3543template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3544template <
class t_ANY_TYPE>
3547 t_ANY_TYPE&& value) &&
3550 return t_TYPE(std::move(d_value.value()));
3553 return t_TYPE(std::forward<t_ANY_TYPE>(value));
3557# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
3558template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3559template <
class t_ANY_TYPE>
3562 bsl::allocator_arg_t,
3563 allocator_type allocator,
3564 t_ANY_TYPE&& value) &&
3567 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3569 std::move(d_value.value()));
3572 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3574 std::forward<t_ANY_TYPE>(value));
3580template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3582Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>&
3585 if (rhs.has_value()) {
3586 if (this->has_value()) {
3587 d_value.
value() = *rhs;
3599template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3603 BloombergLP::bslmf::MovableRef<Optional_Base> rhs)
3607 if (lvalue.has_value()) {
3608 if (this->has_value()) {
3609 d_value.value() = MoveUtil::move(*lvalue);
3612 emplace(MoveUtil::move(*lvalue));
3621template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3630# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3631template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3637 return d_value.value();
3640template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3646 return std::move(d_value.value());
3650template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3656 return d_value.value();
3663template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3672template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3678 return d_value.hasValue();
3681# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3682template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3689 return d_value.value();
3692template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3699 return std::move(d_value.value());
3703template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3710 return d_value.value();
3715# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3716template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3717template <
class t_ANY_TYPE>
3723 return t_TYPE(d_value.value());
3731# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
3732template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3733template <
class t_ANY_TYPE>
3736 bsl::allocator_arg_t,
3737 allocator_type allocator,
3741 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3742 allocator, d_value.value());
3745 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3752template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3753template <
class t_ANY_TYPE>
3759 return t_TYPE(d_value.value());
3767# ifdef BSLS_COMPILERFEATURES_GUARANTEED_COPY_ELISION
3768template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3769template <
class t_ANY_TYPE>
3772 bsl::allocator_arg_t,
3773 allocator_type allocator,
3777 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3778 allocator, d_value.value());
3781 return BloombergLP::bslma::ConstructionUtil::make<t_TYPE>(
3789template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3798# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
3799template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3805 return d_value.value();
3808template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3814 return std::move(d_value.value());
3818template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3824 return d_value.value();
3828#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
3829template <
class t_TYPE,
bool t_USES_BSLMA_ALLOC>
3845# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3847template <
class t_TYPE>
3853template <
class t_TYPE>
3859template <
class t_TYPE>
3860template <
class t_ANY_TYPE>
3863 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
3865: StdOptionalBase(
std::forward<t_ANY_TYPE>(value))
3869template <
class t_TYPE>
3870template <
class t_ANY_TYPE>
3873 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
3874 const Optional_Base<t_ANY_TYPE>& original)
3876 if (original.has_value()) {
3877 this->emplace(original.value());
3881template <
class t_TYPE>
3882template <
class t_ANY_TYPE>
3885 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3886 Optional_Base<t_ANY_TYPE>&& original)
3888 if (original.has_value()) {
3889 this->emplace(std::move(original.value()));
3893template <
class t_TYPE>
3894template <
class t_ANY_TYPE>
3897 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
3898 const std::optional<t_ANY_TYPE>& original)
3899: StdOptionalBase(original)
3903template <
class t_TYPE>
3904template <
class t_ANY_TYPE>
3907 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
3908 std::optional<t_ANY_TYPE>&& original)
3909: StdOptionalBase(
std::move(original))
3913template <
class t_TYPE>
3914template <
class... t_ARGS>
3921template <
class t_TYPE>
3922template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
3926 std::initializer_list<t_INIT_LIST_TYPE> il,
3928: StdOptionalBase(
bsl::
in_place, il,
std::forward<t_ARGS>(args)...)
3932template <
class t_TYPE>
3939template <
class t_TYPE>
3948template <
class t_TYPE>
3949template <
class t_ANY_TYPE>
3952 bsl::allocator_arg_t,
3954 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
3960template <
class t_TYPE>
3961template <
class t_ANY_TYPE>
3964 bsl::allocator_arg_t,
3966 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
3967 const Optional_Base<t_ANY_TYPE>&)
3972template <
class t_TYPE>
3973template <
class t_ANY_TYPE>
3976 bsl::allocator_arg_t,
3978 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
3979 Optional_Base<t_ANY_TYPE>&&)
3984template <
class t_TYPE>
3985template <
class t_ANY_TYPE>
3988 bsl::allocator_arg_t,
3990 BloombergLP::bslstl::Optional_CopyConstructFromStdOptional,
3991 const std::optional<t_ANY_TYPE>&)
3996template <
class t_TYPE>
3997template <
class t_ANY_TYPE>
4000 bsl::allocator_arg_t,
4002 BloombergLP::bslstl::Optional_MoveConstructFromStdOptional,
4003 std::optional<t_ANY_TYPE>&&)
4008template <
class t_TYPE>
4009template <
class... t_ARGS>
4019template <
class t_TYPE>
4020template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4023 bsl::allocator_arg_t,
4026 std::initializer_list<t_INIT_LIST_TYPE>,
4033template <
class t_TYPE>
4034template <
class t_ANY_TYPE>
4037 StdOptionalBase::operator=(std::forward<t_ANY_TYPE>(rhs));
4040# ifndef BDE_OMIT_INTERNAL_DEPRECATED
4041template <
class t_TYPE>
4052template <
class t_TYPE>
4069template <
class t_TYPE>
4075template <
class t_TYPE>
4081template <
class t_TYPE>
4085 if (original.has_value()) {
4086 emplace(original.value());
4090template <
class t_TYPE>
4093 BloombergLP::bslmf::MovableRef<Optional_Base> original)
4099 if (lvalue.has_value()) {
4100 emplace(MoveUtil::move(*lvalue));
4104template <
class t_TYPE>
4105template <
class t_ANY_TYPE>
4108 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
4114template <
class t_TYPE>
4115template <
class t_ANY_TYPE>
4118 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
4121 if (original.has_value()) {
4122 emplace(original.value());
4126template <
class t_TYPE>
4127template <
class t_ANY_TYPE>
4130 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
4134 if (lvalue.has_value()) {
4135 emplace(MoveUtil::move(*lvalue));
4139#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4140template <
class t_TYPE>
4141template <
class... t_ARGS>
4150# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4151template <
class t_TYPE>
4152template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4156 std::initializer_list<t_INIT_LIST_TYPE> il,
4164template <
class t_TYPE>
4171template <
class t_TYPE>
4180template <
class t_TYPE>
4189template <
class t_TYPE>
4192 bsl::allocator_arg_t,
4194 BloombergLP::bslmf::MovableRef<Optional_Base>)
4199template <
class t_TYPE>
4200template <
class t_ANY_TYPE>
4203 bsl::allocator_arg_t,
4205 BloombergLP::bslstl::Optional_ConstructFromForwardRef,
4211template <
class t_TYPE>
4212template <
class t_ANY_TYPE>
4215 bsl::allocator_arg_t,
4217 BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional,
4223template <
class t_TYPE>
4224template <
class t_ANY_TYPE>
4227 bsl::allocator_arg_t,
4229 BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional,
4235#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4236template <
class t_TYPE>
4237template <
class... t_ARGS>
4240 bsl::allocator_arg_t,
4248# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4249template <
class t_TYPE>
4250template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4253 bsl::allocator_arg_t,
4256 std::initializer_list<t_INIT_LIST_TYPE>,
4265template <
class t_TYPE>
4266template <
class t_ANY_TYPE>
4277# ifndef BDE_OMIT_INTERNAL_DEPRECATED
4278template <
class t_TYPE>
4284 return d_value.value();
4289template <
class t_TYPE>
4295 return d_value.value();
4301#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4302template <
class t_TYPE>
4303template <
class... t_ARGS>
4309 return d_value.emplace(NULL,
4313# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4314template <
class t_TYPE>
4315template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4317 std::initializer_list<t_INIT_LIST_TYPE> il,
4320 return d_value.emplace(
4326template <
class t_TYPE>
4333template <
class t_TYPE>
4337 bsl::is_nothrow_swappable<t_TYPE>::value)
4339 if (this->has_value() && other.has_value()) {
4340 BloombergLP::bslalg::SwapUtil::swap(
4344 else if (this->has_value()) {
4345 other.emplace(MoveUtil::move(d_value.value()));
4348 else if (other.has_value()) {
4349 this->emplace(MoveUtil::move(*other));
4354# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4355template <
class t_TYPE>
4362 return d_value.value();
4364template <
class t_TYPE>
4372 return std::move(d_value.value());
4376template <
class t_TYPE>
4383 return d_value.value();
4388# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4389template <
class t_TYPE>
4390template <
class t_ANY_TYPE>
4396 return t_TYPE(std::move(d_value.value()));
4399 return t_TYPE(std::forward<t_ANY_TYPE>(value));
4404template <
class t_TYPE>
4406Optional_Base<t_TYPE, false>&
4409 if (rhs.has_value()) {
4410 if (this->has_value()) {
4411 d_value.
value() = *rhs;
4423template <
class t_TYPE>
4427 BloombergLP::bslmf::MovableRef<Optional_Base> rhs)
4430 if (lvalue.has_value()) {
4431 if (this->has_value()) {
4432 d_value.value() = MoveUtil::move(*lvalue);
4435 emplace(MoveUtil::move(*lvalue));
4444# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4445template <
class t_TYPE>
4451 return d_value.value();
4454template <
class t_TYPE>
4460 return std::move(d_value.value());
4463template <
class t_TYPE>
4469 return d_value.value();
4473template <
class t_TYPE>
4484template <
class t_TYPE>
4488 return d_value.hasValue();
4491# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4492template <
class t_TYPE>
4500 return d_value.value();
4503template <
class t_TYPE>
4511 return std::move(d_value.value());
4515template <
class t_TYPE>
4523 return d_value.value();
4528# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4530template <
class t_TYPE>
4531template <
class t_ANY_TYPE>
4539 return t_TYPE(d_value.value());
4548template <
class t_TYPE>
4549template <
class t_ANY_TYPE>
4557 return t_TYPE(d_value.value());
4567template <
class t_TYPE>
4576# ifdef BSLS_COMPILERFEATURES_SUPPORT_REF_QUALIFIERS
4577template <
class t_TYPE>
4583 return d_value.value();
4586template <
class t_TYPE>
4592 return std::move(d_value.value());
4596template <
class t_TYPE>
4602 return d_value.value();
4606#ifdef BSLS_COMPILERFEATURES_SUPPORT_OPERATOR_EXPLICIT
4607template <
class t_TYPE>
4629template <
class t_TYPE>
4635template <
class t_TYPE>
4641#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
4642template <
class t_TYPE>
4643template <
class t_DERIVED>
4645 BloombergLP::bslmf::MovableRef<t_DERIVED> original,
4649: BaseType(MoveUtil::move(static_cast<BaseType&>(original)))
4654template <
class t_TYPE>
4655template <
class t_ANY_TYPE>
4660: BaseType(BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
4665template <
class t_TYPE>
4666template <
class t_ANY_TYPE>
4671: BaseType(BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
4676template <
class t_TYPE>
4677template <
class t_ANY_TYPE>
4684: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
4689template <
class t_TYPE>
4690template <
class t_ANY_TYPE>
4696: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
4701template <
class t_TYPE>
4702template <
class t_ANY_TYPE>
4707: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
4709 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
4714template <
class t_TYPE>
4715template <
class t_ANY_TYPE>
4720: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
4722 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
4727#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
4728template <
class t_TYPE>
4729template <
class t_ANY_TYPE>
4731 const std::optional<t_ANY_TYPE>& original,
4735: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
4740template <
class t_TYPE>
4741template <
class t_ANY_TYPE>
4743 const std::optional<t_ANY_TYPE>& original,
4747: BaseType(BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
4752template <
class t_TYPE>
4753template <
class t_ANY_TYPE>
4755 std::optional<t_ANY_TYPE>&& original,
4758: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
4759 std::move(original))
4763template <
class t_TYPE>
4764template <
class t_ANY_TYPE>
4766 std::optional<t_ANY_TYPE>&& original,
4769: BaseType(BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
4770 std::move(original))
4775#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4776template <
class t_TYPE>
4777template <
class... t_ARGS>
4783#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
4784template <
class t_TYPE>
4785template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
4787 std::initializer_list<t_INIT_LIST_TYPE> il,
4795template <
class t_TYPE>
4801template <
class t_TYPE>
4809template <
class t_TYPE>
4817template <
class t_TYPE>
4818template <
class t_DERIVED>
4823 typename bsl::remove_reference<t_DERIVED>::type))
4824: BaseType(
bsl::allocator_arg_t(),
4826 MoveUtil::move(static_cast<BaseType&>(original)))
4833template <
class t_TYPE>
4834template <
class t_ANY_TYPE>
4836 bsl::allocator_arg_t,
4841: BaseType(
bsl::allocator_arg_t(),
4843 BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
4848template <
class t_TYPE>
4849template <
class t_ANY_TYPE>
4851 bsl::allocator_arg_t,
4856: BaseType(
bsl::allocator_arg_t(),
4858 BloombergLP::
bslstl::Optional_ConstructFromForwardRef(),
4863template <
class t_TYPE>
4864template <
class t_ANY_TYPE>
4866 bsl::allocator_arg_t,
4873: BaseType(
bsl::allocator_arg_t(),
4875 BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
4880template <
class t_TYPE>
4881template <
class t_ANY_TYPE>
4883 bsl::allocator_arg_t,
4889: BaseType(
bsl::allocator_arg_t(),
4891 BloombergLP::
bslstl::Optional_CopyConstructFromOtherOptional(),
4896template <
class t_TYPE>
4897template <
class t_ANY_TYPE>
4899 bsl::allocator_arg_t,
4904: BaseType(
bsl::allocator_arg_t(),
4906 BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
4908 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
4913template <
class t_TYPE>
4914template <
class t_ANY_TYPE>
4916 bsl::allocator_arg_t,
4921: BaseType(
bsl::allocator_arg_t(),
4923 BloombergLP::
bslstl::Optional_MoveConstructFromOtherOptional(),
4925 static_cast<BloombergLP::
bslstl::Optional_Base<t_ANY_TYPE>&>(
4930#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
4931template <
class t_TYPE>
4932template <
class t_ANY_TYPE>
4934 bsl::allocator_arg_t,
4936 const std::optional<t_ANY_TYPE>& original,
4941: BaseType(
bsl::allocator_arg_t(),
4943 BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
4948template <
class t_TYPE>
4949template <
class t_ANY_TYPE>
4951 bsl::allocator_arg_t,
4952 AllocType allocator,
4953 const std::optional<t_ANY_TYPE>& original,
4957: BaseType(
bsl::allocator_arg_t(),
4959 BloombergLP::
bslstl::Optional_CopyConstructFromStdOptional(),
4964template <
class t_TYPE>
4965template <
class t_ANY_TYPE>
4967 bsl::allocator_arg_t,
4968 AllocType allocator,
4969 std::optional<t_ANY_TYPE>&& original,
4972: BaseType(
bsl::allocator_arg_t(),
4974 BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
4975 std::move(original))
4979template <
class t_TYPE>
4980template <
class t_ANY_TYPE>
4982 bsl::allocator_arg_t,
4983 AllocType allocator,
4984 std::optional<t_ANY_TYPE>&& original,
4987: BaseType(
bsl::allocator_arg_t(),
4989 BloombergLP::
bslstl::Optional_MoveConstructFromStdOptional(),
4990 std::move(original))
4995#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
4996template <
class t_TYPE>
4997template <
class... t_ARGS>
4999 bsl::allocator_arg_t,
5003: BaseType(
bsl::allocator_arg,
5009#if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS)
5010template <
class t_TYPE>
5011template <
class t_INIT_LIST_TYPE,
class... t_ARGS>
5013 bsl::allocator_arg_t,
5016 std::initializer_list<t_INIT_LIST_TYPE> il,
5018: BaseType(
bsl::allocator_arg,
5029template <
class t_TYPE>
5037#if !defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5038template <
class t_TYPE>
5039template <
class t_DERIVED>
5043 BaseType& lvalue = rhs;
5044 BaseType::operator=(MoveUtil::move(lvalue));
5049template <
class t_TYPE>
5050template <
class t_ANY_TYPE>
5054 if (rhs.has_value()) {
5055 this->assignOrEmplace(*rhs);
5062template <
class t_TYPE>
5063template <
class t_ANY_TYPE>
5067 BloombergLP::bslstl::Optional_Base<t_ANY_TYPE>& lvalue = rhs;
5068 if (lvalue.has_value()) {
5069 this->assignOrEmplace(MoveUtil::move(*lvalue));
5076#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES)
5077template <
class t_TYPE>
5078template <
class t_ANY_TYPE>
5082 this->assignOrEmplace(std::forward<t_ANY_TYPE>(rhs));
5086template <
class t_TYPE>
5089 this->assignOrEmplace(rhs);
5093template <
class t_TYPE>
5097 this->assignOrEmplace(MoveUtil::move(rhs));
5101template <
class t_TYPE>
5102template <
class t_ANY_TYPE>
5106 this->assignOrEmplace(rhs);
5110template <
class t_TYPE>
5111template <
class t_ANY_TYPE>
5115 this->assignOrEmplace(MoveUtil::move(rhs));
5120#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5121template <
class t_TYPE>
5122template <
class t_ANY_TYPE>
5126 if (rhs.has_value()) {
5127 this->assignOrEmplace(*rhs);
5134template <
class t_TYPE>
5135template <
class t_ANY_TYPE>
5139 if (rhs.has_value()) {
5140 this->assignOrEmplace(std::move(*rhs));
5152template <
class t_TYPE>
5158 if (lhs.get_allocator() == rhs.get_allocator()) {
5165 bsl::allocator_arg, lhs.get_allocator(), rhs);
5167 bsl::allocator_arg, rhs.get_allocator(), lhs);
5169 futureLhs.swap(lhs);
5170 futureRhs.swap(rhs);
5173template <
class t_TYPE>
5183template <
class t_HASHALG,
class t_TYPE>
5186 using ::BloombergLP::bslh::hashAppend;
5188 if (input.has_value()) {
5199template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5203 { *lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5206 if (lhs.has_value() && rhs.has_value()) {
5207 return *lhs == *rhs;
5209 return lhs.has_value() == rhs.has_value();
5212template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5216 { *lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5219 if (lhs.has_value() && rhs.has_value()) {
5220 return *lhs != *rhs;
5223 return lhs.has_value() != rhs.has_value();
5226template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5230 { *lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5233 if (!rhs.has_value()) {
5237 return !lhs.has_value() || *lhs < *rhs;
5240template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5244 { *lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5247 if (!lhs.has_value()) {
5251 return !rhs.has_value() || *lhs > *rhs;
5254template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5258 { *lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5261 if (!lhs.has_value()) {
5265 return rhs.has_value() && *lhs <= *rhs;
5268template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5272 { *lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5275 if (!rhs.has_value()) {
5278 return lhs.has_value() && *lhs >= *rhs;
5283template <
class t_TYPE>
5289 return !value.has_value();
5292#if !(defined(BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON) && \
5293 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS))
5294template <
class t_TYPE>
5300 return !value.has_value();
5303template <
class t_TYPE>
5309 return value.has_value();
5312template <
class t_TYPE>
5318 return value.has_value();
5321template <
class t_TYPE>
5330template <
class t_TYPE>
5336 return value.has_value();
5339template <
class t_TYPE>
5345 return value.has_value();
5348template <
class t_TYPE>
5357template <
class t_TYPE>
5363 return !value.has_value();
5366template <
class t_TYPE>
5375template <
class t_TYPE>
5384template <
class t_TYPE>
5390 return !value.has_value();
5397template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5400 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5402 { *lhs == rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5405 return lhs.has_value() && *lhs == rhs;
5408template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5411 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5413 { lhs == *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5416 return rhs.has_value() && lhs == *rhs;
5419template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5422 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5424 { *lhs != rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5427 return !lhs.has_value() || *lhs != rhs;
5430template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5433 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5435 { lhs != *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5438 return !rhs.has_value() || lhs != *rhs;
5441template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5444 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5446 { *lhs < rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5449 return !lhs.has_value() || *lhs < rhs;
5452template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5455 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5457 { lhs < *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5460 return rhs.has_value() && lhs < *rhs;
5463template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5466 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5468 { *lhs > rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5471 return lhs.has_value() && *lhs > rhs;
5474template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5477 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5479 { lhs > *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5482 return !rhs.has_value() || lhs > *rhs;
5485template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5488 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5490 { *lhs <= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5493 return !lhs.has_value() || *lhs <= rhs;
5496template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5499 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5501 { lhs <= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5504 return rhs.has_value() && lhs <= *rhs;
5507template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5510 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS_TYPE>
5512 { *lhs >= rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5515 return lhs.has_value() && *lhs >= rhs;
5518template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5521 !BloombergLP::bslstl::Optional_DerivedFromOptional<t_LHS_TYPE>
5523 { lhs >= *rhs } -> BloombergLP::bslstl::Optional_ConvertibleToBool;
5526 return !rhs.has_value() || lhs >= *rhs;
5529#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON \
5530 && defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
5531template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
5532constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5536 const bool lhs_has_value = lhs.has_value(),
5537 rhs_has_value = rhs.has_value();
5538 if (lhs_has_value && rhs_has_value) {
5539 return *lhs <=> *rhs;
5541 return lhs_has_value <=> rhs_has_value;
5544template <
class t_LHS,
class t_RHS>
5545requires (!BloombergLP::bslstl::Optional_DerivedFromOptional<t_RHS>) &&
5546 three_way_comparable_with<t_LHS, t_RHS>
5547constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5552 return *lhs <=> rhs;
5554 return strong_ordering::less;
5557template <
class t_TYPE>
5561 return value.has_value() <=>
false;
5564template <
class t_LHS, three_way_comparable_with<t_LHS> t_RHS>
5565constexpr compare_three_way_result_t<t_LHS, t_RHS> operator<=>(
5567 const std::optional<t_RHS>& rhs)
5569 const bool lhs_has_value = lhs.has_value(),
5570 rhs_has_value = rhs.has_value();
5571 if (lhs_has_value && rhs_has_value) {
5572 return *lhs <=> *rhs;
5574 return lhs_has_value <=> rhs_has_value;
5579# ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5580template <
class t_TYPE>
5589template <
class t_TYPE>
5600template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5603 const std::optional<t_RHS_TYPE>& rhs)
5605 if (lhs.has_value() && rhs.has_value()) {
5606 return *lhs == *rhs;
5608 return lhs.has_value() == rhs.has_value();
5611template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5613bool operator==(
const std::optional<t_LHS_TYPE>& lhs,
5616 if (lhs.has_value() && rhs.has_value()) {
5617 return *lhs == *rhs;
5619 return lhs.has_value() == rhs.has_value();
5622template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5625 const std::optional<t_RHS_TYPE>& rhs)
5627 if (lhs.has_value() && rhs.has_value()) {
5628 return *lhs != *rhs;
5631 return lhs.has_value() != rhs.has_value();
5634template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5636bool operator!=(
const std::optional<t_LHS_TYPE>& lhs,
5639 if (lhs.has_value() && rhs.has_value()) {
5640 return *lhs != *rhs;
5643 return lhs.has_value() != rhs.has_value();
5646template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5649 const std::optional<t_RHS_TYPE>& rhs)
5651 if (!rhs.has_value()) {
5655 return !lhs.has_value() || *lhs < *rhs;
5658template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5660bool operator<(
const std::optional<t_LHS_TYPE>& lhs,
5663 if (!rhs.has_value()) {
5667 return !lhs.has_value() || *lhs < *rhs;
5670template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5673 const std::optional<t_RHS_TYPE>& rhs)
5675 if (!lhs.has_value()) {
5679 return !rhs.has_value() || *lhs > *rhs;
5682template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5684bool operator>(
const std::optional<t_LHS_TYPE>& lhs,
5687 if (!lhs.has_value()) {
5691 return !rhs.has_value() || *lhs > *rhs;
5694template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5697 const std::optional<t_RHS_TYPE>& rhs)
5699 if (!lhs.has_value()) {
5703 return rhs.has_value() && *lhs <= *rhs;
5706template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5708bool operator<=(
const std::optional<t_LHS_TYPE>& lhs,
5711 if (!lhs.has_value()) {
5715 return rhs.has_value() && *lhs <= *rhs;
5718template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5721 const std::optional<t_RHS_TYPE>& rhs)
5723 if (!rhs.has_value()) {
5726 return lhs.has_value() && *lhs >= *rhs;
5729template <
class t_LHS_TYPE,
class t_RHS_TYPE>
5731bool operator>=(
const std::optional<t_LHS_TYPE>& lhs,
5734 if (!rhs.has_value()) {
5737 return lhs.has_value() && *lhs >= *rhs;
5741template <
class t_TYPE>
5755#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
5756template <
class t_TYPE,
class... t_ARGS>
5758 bsl::allocator_arg_t,
5770#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
5771# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
5772 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
5773template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
5775 bsl::allocator_arg_t,
5777 std::initializer_list<t_INIT_LIST_TYPE> il,
5790template <
class t_TYPE>
5798template <
class t_TYPE>
5804#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
5805template <
class t_TYPE,
class t_ARG,
class... t_ARGS>
5816# if defined(BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS) && \
5817 !(defined(BSLS_PLATFORM_CMP_MSVC) && BSLS_PLATFORM_CMP_VERSION < 1900)
5818template <
class t_TYPE,
class t_INIT_LIST_TYPE,
class... t_ARGS>
5820 std::initializer_list<t_INIT_LIST_TYPE> il,
5856# if BSLS_COMPILERFEATURES_CPLUSPLUS==202002L && \
5857 defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
5858 (11 <= _GLIBCXX_RELEASE && _GLIBCXX_RELEASE < 14)
5860#define BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_GNU_WORKAROUND_NEEDED
5863template<
typename _Tp>
5864inline constexpr bool __is_optional_v<bsl::optional<_Tp>> =
true;
5869# if BSLS_COMPILERFEATURES_CPLUSPLUS == 202002L && \
5870 defined(BSLS_PLATFORM_CMP_MSVC) && \
5871 (BSLS_PLATFORM_CMP_VERSION >= 1930 && BSLS_PLATFORM_CMP_VERSION < 1936)
5874#define BSLSTL_OPTIONAL_CPP20_IS_OPTIONAL_MSVC_WORKAROUND_NEEDED
5877template <
typename _Tp>
5878inline constexpr bool _Is_specialization_v<bsl::optional<_Tp>, std::optional> =
5884#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL
5885#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL
5886#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL
5887#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL
5888#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR
5889#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR
5890#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR
5891#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR
5892#undef BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM
5893#undef BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM
5894#undef BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL
5895#undef BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT
5896#undef BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT
5897#undef BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT
5898#undef BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT
5899#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL
5900#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL
5901#undef BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED
5902#undef BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG
5903#undef BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG
5904#undef BSLSTL_OPTIONAL_REQUIRES
#define BSLMF_NESTED_TRAIT_DECLARATION_IF(t_TYPE, t_TRAIT, t_COND)
Definition bslmf_nestedtraitdeclaration.h:243
Definition bslma_bslallocator.h:580
BloombergLP::bslma::Allocator * mechanism() const
Definition bslma_bslallocator.h:1126
decay_imp< U, k_ISARRAY, k_ISFUNC >::type type
Definition bslmf_decay.h:166
Definition bslstl_optional.h:1861
BSLMF_NESTED_TRAIT_DECLARATION_IF(optional, BloombergLP::bslmf::UsesAllocatorArgT, BloombergLP::bslma::UsesBslmaAllocator< t_TYPE >::value)
optional() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:4630
BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(t_TYPE, t_ANY_TYPE) &operator
optional(bsl::allocator_arg_t, AllocType allocator)
Definition bslstl_optional.h:4796
BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(t_TYPE, t_DERIVED) &operator
optional(bsl::allocator_arg_t, AllocType allocator, BSLMF_MOVABLEREF_DEDUCE(t_DERIVED) original, BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(typename bsl::remove_reference< t_DERIVED >::type))
BSLMF_NESTED_TRAIT_DECLARATION_IF(optional, BloombergLP::bslmf::IsBitwiseCopyable, BloombergLP::bslmf::IsBitwiseCopyable< t_TYPE >::value)
BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(t_TYPE, t_ANY_TYPE) &operator
optional(bsl::allocator_arg_t, AllocType allocator, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional(BSLMF_MOVABLEREF_DEDUCE(optional< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional(bsl::allocator_arg_t, AllocType allocator, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional & operator=(const t_TYPE &rhs)
Definition bslstl_optional.h:5087
optional(bsl::allocator_arg_t, AllocType allocator, const optional &original)
Definition bslstl_optional.h:4810
optional & operator=(bsl::nullopt_t) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:5031
optional(BSLMF_MOVABLEREF_DEDUCE(optional< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional(bsl::allocator_arg_t, AllocType allocator, bsl::nullopt_t)
Definition bslstl_optional.h:4802
optional & operator=(BloombergLP::bslmf::MovableRef< t_TYPE > rhs)
Definition bslstl_optional.h:5095
optional(bsl::allocator_arg_t, AllocType allocator, BSLMF_MOVABLEREF_DEDUCE(optional< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional(BloombergLP::bslmf::MovableRef< t_DERIVED > original, BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(t_DERIVED)) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
BSLMF_NESTED_TRAIT_DECLARATION_IF(optional, BloombergLP::bslma::UsesBslmaAllocator, BloombergLP::bslma::UsesBslmaAllocator< t_TYPE >::value)
optional(bsl::allocator_arg_t, AllocType allocator, bsl::in_place_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
Definition bslstl_optional.h:4998
optional(bsl::allocator_arg_t, AllocType allocator, const optional< t_ANY_TYPE > &original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, const t_ANY_TYPE &), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, const t_ANY_TYPE &))
BSLMF_NESTED_TRAIT_DECLARATION_IF(optional, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< t_TYPE >::value)
optional(bsl::in_place_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
Definition bslstl_optional.h:4778
optional(const optional< t_ANY_TYPE > &original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, const t_ANY_TYPE &), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, const t_ANY_TYPE &))
optional(bsl::allocator_arg_t, AllocType allocator, const optional< t_ANY_TYPE > &original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, const t_ANY_TYPE &), BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(t_TYPE, const t_ANY_TYPE &))
optional(const optional< t_ANY_TYPE > &original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, const t_ANY_TYPE &), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, const t_ANY_TYPE &))
optional(bsl::allocator_arg_t, AllocType allocator, BSLMF_MOVABLEREF_DEDUCE(optional< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(t_TYPE, t_ANY_TYPE), BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(t_TYPE, t_ANY_TYPE))
BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(t_TYPE, const t_ANY_TYPE &) &operator
Definition bslma_allocator.h:457
void swap(Optional_Base &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl t_TYPE & value()
Definition bslstl_optional.h:1730
const t_TYPE & value() const
BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Base, BloombergLP::bslmf::IsBitwiseCopyable, BloombergLP::bslmf::IsBitwiseCopyable< t_TYPE >::value)
BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Base, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< t_TYPE >::value)
Optional_Base(BloombergLP::bslmf::MovableRef< Optional_Base > original) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value)
t_TYPE value_type
Definition bslstl_optional.h:1665
Definition bslstl_optional.h:803
Optional_Base()
Definition bslstl_optional.h:3125
const t_TYPE & value() const
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
BSLMF_NESTED_TRAIT_DECLARATION(Optional_Base, BloombergLP::bslmf::UsesAllocatorArgT)
t_TYPE & operator*()
Definition bslstl_optional.h:3652
void reset() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:3480
BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Base, BloombergLP::bslmf::IsBitwiseCopyable, BloombergLP::bslmf::IsBitwiseCopyable< t_TYPE >::value)
BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Base, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< t_TYPE >::value)
BSLMF_NESTED_TRAIT_DECLARATION(Optional_Base, BloombergLP::bslma::UsesBslmaAllocator)
Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional, BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR(t_TYPE, t_ANY_TYPE))
Optional_Base(BloombergLP::bslmf::MovableRef< Optional_Base > original) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl Optional_Base(BloombergLP::bslstl::Optional_ConstructFromForwardRef, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value)
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
Optional_Base(BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional, BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(t_TYPE, t_ANY_TYPE))
#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_IDENT(str)
Definition bsls_ident.h:195
#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)
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 bslmf_issame.h:146
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 bslma_usesbslmaallocator.h:343
Definition bslmf_isbitwisecopyable.h:298
Definition bslstl_optional.h:615
Definition bslstl_optional.h:604
Definition bslstl_optional.h:616
Definition bslstl_optional.h:618
Definition bslstl_optional.h:635
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
BSLMF_NESTED_TRAIT_DECLARATION_IF(Optional_Data, bslmf::IsBitwiseCopyable, bslmf::IsBitwiseCopyable< t_TYPE >::value)
Definition bslstl_optional.h:724
~Optional_Data()
Destroy the managed value_type object, if it exists.
Definition bslstl_optional.h:3109
Definition bslstl_optional.h:521
Definition bslstl_optional.h:617
Definition bslstl_optional.h:619
Definition bslstl_optional.h:449
Definition bslstl_optional.h:551
BSLS_KEYWORD_CONSTEXPR Optional_OptNoSuchType(int) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_optional.h:563
Definition bslstl_optional.h:585
Definition bsls_objectbuffer.h:276