BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_optional.h File Reference
#include <bsls_ident.h>
#include <bslscm_version.h>
#include <bslstl_badoptionalaccess.h>
#include <bslstl_compare.h>
#include <bslstl_hash.h>
#include <bslstl_inplace.h>
#include <bslalg_swaputil.h>
#include <bslma_constructionutil.h>
#include <bslma_default.h>
#include <bslma_destructionutil.h>
#include <bslma_bslallocator.h>
#include <bslma_usesbslmaallocator.h>
#include <bslmf_allocatorargt.h>
#include <bslmf_decay.h>
#include <bslmf_integralconstant.h>
#include <bslmf_isaccessiblebaseof.h>
#include <bslmf_isbitwisecopyable.h>
#include <bslmf_isbitwisemoveable.h>
#include <bslmf_isconvertible.h>
#include <bslmf_isnothrowmoveconstructible.h>
#include <bslmf_isnothrowswappable.h>
#include <bslmf_issame.h>
#include <bslmf_movableref.h>
#include <bslmf_nestedtraitdeclaration.h>
#include <bslmf_removeconst.h>
#include <bslmf_removecvref.h>
#include <bslmf_util.h>
#include <bsls_assert.h>
#include <bsls_compilerfeatures.h>
#include <bsls_exceptionutil.h>
#include <bsls_keyword.h>
#include <bsls_libraryfeatures.h>
#include <bsls_objectbuffer.h>
#include <bsls_platform.h>
#include <bsls_unspecifiedbool.h>
#include <bsls_util.h>
#include <stddef.h>
#include <bslmf_if.h>
#include <type_traits>

Go to the source code of this file.

Classes

struct  bslstl::Optional_NulloptConstructToken
 
struct  bsl::nullopt_t
 
struct  bslstl::Optional_IsTriviallyDestructible< t_TYPE >
 
struct  bslstl::Optional_OptNoSuchType
 
struct  bslstl::Optional_PropagatesAllocator< t_TYPE, t_ANY_TYPE >
 
struct  bslstl::Optional_ConstructsFromType< t_TYPE, t_ANY_TYPE >
 
struct  bslstl::Optional_ConstructFromForwardRef
 
struct  bslstl::Optional_CopyConstructFromOtherOptional
 
struct  bslstl::Optional_MoveConstructFromOtherOptional
 
struct  bslstl::Optional_CopyConstructFromStdOptional
 
struct  bslstl::Optional_MoveConstructFromStdOptional
 
struct  bslstl::Optional_DataImp< t_TYPE >
 
struct  bslstl::Optional_Data< t_TYPE, t_IS_TRIVIALLY_DESTRUCTIBLE >
 
struct  bslstl::Optional_Data< t_TYPE, true >
 
class  bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >
 
class  bslstl::Optional_Base< t_TYPE, false >
 
struct  bslstl::Optional_Base< t_TYPE, false >::AllocType
 
class  bsl::optional< t_TYPE >
 
struct  bslma::UsesBslmaAllocator< bslstl::Optional_Base< t_TYPE, false > >
 
struct  bslma::UsesBslmaAllocator< bsl::optional< t_TYPE > >
 

Macros

#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT)    std::is_constructible<U, V>::value
 
#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT)    std::is_assignable<U, V>::value
 
#define BSLSTL_OPTIONAL_CONVERTS_FROM(TYPE, OPT_TYPE)
 
#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE)
 
#define BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)   false
 
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)   false
 
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR( TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT(U, V)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(U, V)
 
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
 
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
 
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(TYPE, DERIVED)
 
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(TYPE, ANY_TYPE)
 
#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG)
 
#define BSLSTL_OPTIONAL_DEFAULT_TEMPLATE_ARG(ARG)
 
#define BSLSTL_OPTIONAL_REQUIRES(EXPR)
 

Functions

template<class t_TYPE >
bsl::enable_if< BloombergLP::bslma::UsesBslmaAllocator< t_TYPE >::value, void >::type bsl::swap (bsl::optional< t_TYPE > &lhs, bsl::optional< t_TYPE > &rhs)
 
template<class t_TYPE >
bsl::enable_if<!BloombergLP::bslma::UsesBslmaAllocator< t_TYPE >::value, void >::type bsl::swap (bsl::optional< t_TYPE > &lhs, bsl::optional< t_TYPE > &rhs)
 
template<class t_HASHALG , class t_TYPE >
void bsl::hashAppend (t_HASHALG &hashAlg, const optional< t_TYPE > &input)
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator== (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator!= (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator< (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator> (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator<= (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator>= (const bsl::optional< t_LHS_TYPE > &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator== (const bsl::optional< t_TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator== (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &value) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator!= (const bsl::optional< t_TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator!= (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &value) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator< (const bsl::optional< t_TYPE > &, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator< (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &value) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator> (const bsl::optional< t_TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator> (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator<= (const bsl::optional< t_TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator<= (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator>= (const bsl::optional< t_TYPE > &, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator>= (const bsl::nullopt_t &, const bsl::optional< t_TYPE > &value) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE , class... t_ARGS>
BSLS_KEYWORD_CONSTEXPR bsl::optional< t_TYPE > bsl::make_optional (bsl::allocator_arg_t, typename bsl::optional< t_TYPE >::allocator_type const &alloc, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bsl::optional< typename bsl::decay< t_TYPE >::type > bsl::make_optional (BSLS_COMPILERFEATURES_FORWARD_REF(t_TYPE) rhs)
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bsl::optional< t_TYPE > bsl::make_optional ()
 
template<class t_TYPE , class t_ARG , class... t_ARGS>
BSLS_KEYWORD_CONSTEXPR bsl::BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG (t_ARG) make_optional(BSLS_COMPILERFEATURES_FORWARD_REF(t_ARG) arg
 
BSLS_KEYWORD_CONSTEXPR bsl::BSLS_COMPILERFEATURES_FORWARD_REF (t_ARGS)... args)
 
template<class t_DERIVED >
 bsl::BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED (t_TYPE, t_DERIVED) &optional< t_TYPE >
 
template<class t_ANY_TYPE >
 bsl::BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL (t_TYPE, const t_ANY_TYPE &) &optional< t_TYPE >
 
template<class t_ANY_TYPE >
 bsl::BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL (t_TYPE, t_ANY_TYPE) &optional< t_TYPE >
 
template<class t_ANY_TYPE >
 bsl::BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE (t_TYPE, t_ANY_TYPE) &optional< t_TYPE >
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator== (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator== (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator!= (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator!= (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator< (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator< (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator> (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator> (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator<= (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator<= (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator>= (const bsl::optional< t_LHS_TYPE > &lhs, const t_RHS_TYPE &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_LHS_TYPE , class t_RHS_TYPE >
bool bsl::operator>= (const t_LHS_TYPE &lhs, const bsl::optional< t_RHS_TYPE > &rhs) BSLSTL_OPTIONAL_REQUIRES(!BloombergLP
 
template<class t_TYPE >
BSLS_KEYWORD_CONSTEXPR bsl::optional< typename bsl::decay< t_TYPE >::type > bsl::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)
 

Variables

const nullopt_t bsl::nullopt
 
template<class t_TYPE >
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 > bsl::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)
 

Detailed Description

The content of this file has been pre-processed for Doxygen.