BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > Class Template Reference

#include <bslstl_optional.h>

Public Types

typedef t_TYPE value_type
 
typedef bsl::allocator< char > allocator_type
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (Optional_Base, BloombergLP::bslma::UsesBslmaAllocator)
 
 BSLMF_NESTED_TRAIT_DECLARATION (Optional_Base, BloombergLP::bslmf::UsesAllocatorArgT)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (Optional_Base, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< t_TYPE >::value)
 
 BSLMF_NESTED_TRAIT_DECLARATION_IF (Optional_Base, BloombergLP::bslmf::IsBitwiseCopyable, BloombergLP::bslmf::IsBitwiseCopyable< t_TYPE >::value)
 
template<class... t_ARGS>
t_TYPE & emplace (BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
 
void reset () BSLS_KEYWORD_NOEXCEPT
 
Optional_Baseoperator= (const Optional_Base &rhs)
 
Optional_Baseoperator= (BloombergLP::bslmf::MovableRef< Optional_Base > rhs)
 
t_TYPE * operator-> ()
 
t_TYPE & operator* ()
 
allocator_type get_allocator () const BSLS_KEYWORD_NOEXCEPT
 Return allocator used for construction of value_type.
 
bool has_value () const BSLS_KEYWORD_NOEXCEPT
 Return false if this object is disengaged, and true otherwise.
 
const t_TYPE & value () const
 
const t_TYPE * operator-> () const
 
const t_TYPE & operator* () const
 
template<class t_ANY_TYPE >
t_TYPE value_or (BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value) const
 
 operator UnspecifiedBool () const BSLS_NOTHROW_SPEC
 
template<class t_ANY_TYPE >
 Optional_Base (BloombergLP::bslstl::Optional_ConstructFromForwardRef, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value)
 
template<class t_ANY_TYPE >
 Optional_Base (BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional, BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR(t_TYPE, t_ANY_TYPE))
 
template<class t_ANY_TYPE >
 Optional_Base (BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional, BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >) original, BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(t_TYPE, t_ANY_TYPE))
 

Public Attributes

void swap(Optional_Base &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl t_TYPE & value ()
 

Protected Types

typedef allocator_type AllocType
 

Protected Member Functions

 Optional_Base ()
 
 Optional_Base (bsl::nullopt_t)
 
 Optional_Base (const Optional_Base &original)
 
template<class 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)
 
template<class t_ANY_TYPE >
 Optional_Base (BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional, const Optional_Base< t_ANY_TYPE > &original)
 
template<class t_ANY_TYPE >
 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))
 
template<class t_ANY_TYPE >
 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))
 
template<class... t_ARGS>
 Optional_Base (bsl::in_place_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
 
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator)
 
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, bsl::nullopt_t)
 
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, const Optional_Base &original)
 
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslmf::MovableRef< Optional_Base > original)
 
template<class t_ANY_TYPE >
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslstl::Optional_ConstructFromForwardRef, BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) value)
 
template<class t_ANY_TYPE >
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional, const Optional_Base< t_ANY_TYPE > &original)
 
template<class t_ANY_TYPE >
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional, BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >) original)
 
template<class... t_ARGS>
 Optional_Base (bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_t, BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)... args)
 
template<class t_ANY_TYPE >
void assignOrEmplace (BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE) rhs)
 
t_TYPE & dereferenceRaw ()
 
const t_TYPE & dereferenceRaw () const
 

Detailed Description

template<class t_TYPE, bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
class bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >

This component-private class template implements the functionality of bsl::optional. The primary template is instantiated when TYPE is allocator-aware, and holds the allocator that is used to create the stored object.

See bslstl_optional

Member Typedef Documentation

◆ allocator_type

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
typedef bsl::allocator<char> bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::allocator_type

◆ AllocType

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
typedef allocator_type bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::AllocType
protected

◆ value_type

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
typedef t_TYPE bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::value_type

value_type is an alias for the underlying TYPE upon which this template class is instantiated, and represents the type of the managed object. The name is chosen so it is compatible with the std::optional implementation.

Constructor & Destructor Documentation

◆ Optional_Base() [1/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( )
inlineprotected

Create a disengaged Optional_Base object. Use the currently installed default allocator to supply memory.

◆ Optional_Base() [2/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::nullopt_t  )
inlineprotected

Create a disengaged Optional_Base object. Use the currently installed default allocator to supply memory.

◆ Optional_Base() [3/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( const Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > &  original)
inlineprotected

◆ Optional_Base() [4/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
Optional_Base(BloombergLP::bslmf::MovableRef< Optional_Base > original) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( BloombergLP::bslstl::Optional_ConstructFromForwardRef  ,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)  value 
)
protected

Create an Optional_Base object having the value of the specified original object. Use the currently installed default allocator to supply memory. Create an Optional_Base object whose contained value is initialized by forwarding from the specified value. Use the currently installed default allocator to supply memory.

◆ Optional_Base() [5/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional  ,
const Optional_Base< t_ANY_TYPE > &  original 
)
inlineprotected

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory.

◆ Optional_Base() [6/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::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)   
)
protected

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() converted to t_TYPE otherwise. Use the currently installed default allocator to supply memory. original is left in a valid but unspecified state.

◆ Optional_Base() [7/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::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)   
)
protected

Create a disengaged Optional_Base object if the specified original object is disengaged, and an Optional_Base object with the value of original.value() otherwise. This is a special case constructor where t_ANY_TYPE is a non-const version of t_TYPE and we use the allocator from original to supply memory. original is left in a valid but unspecified state.

◆ Optional_Base() [8/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class... t_ARGS>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::in_place_t  ,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)...  args 
)
inlineexplicitprotected

Create an Optional_Base object having the value of the (template parameter) t_TYPE created in place using the specified args. Use the currently installed default allocator to supply memory.

◆ Optional_Base() [9/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator 
)
inlineprotected

Create a disengaged Optional_Base object. Use the specified allocator to supply memory.

◆ Optional_Base() [10/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
bsl::nullopt_t   
)
inlineprotected

Create a disengaged Optional_Base object. Use the specified allocator to supply memory.

◆ Optional_Base() [11/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
const Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > &  original 
)
inlineprotected

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from *original. Otherwise, create a disengaged Optional_Base object. Use the specified allocator to supply memory.

◆ Optional_Base() [12/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
BloombergLP::bslmf::MovableRef< Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > >  original 
)
inlineprotected

If the specified original contains a value, create an Optional_Base object whose contained value is initialized by moving *original. Otherwise, create a disengaged Optional_Base object. Use the specified allocator to supply memory. original is left in a valid but unspecified state.

◆ Optional_Base() [13/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
BloombergLP::bslstl::Optional_ConstructFromForwardRef  ,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)  value 
)
inlineprotected

Create an Optional_Base object whose contained value is initialized by forwarding from the specified value. Use the specified allocator to supply memory.

◆ Optional_Base() [14/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
BloombergLP::bslstl::Optional_CopyConstructFromOtherOptional  ,
const Optional_Base< t_ANY_TYPE > &  original 
)
inlineprotected

If the specified original contains a value, create an Optional_Base object whose contained value is initialized from *original, converted to t_TYPE. Otherwise, create a disengaged Optional_Base. Use the specified allocator to supply memory.

◆ Optional_Base() [15/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional  ,
BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >)  original 
)
inlineprotected

If the specified original contains a value, create an Optional_Base object whose contained value is initialized by moving from *original and converting to t_TYPE. Otherwise, create a disengaged Optional_Base. Use the specified allocator to supply memory. original is left in a valid but unspecified state.

◆ Optional_Base() [16/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class... t_ARGS>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( bsl::allocator_arg_t  ,
allocator_type  allocator,
bsl::in_place_t  ,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)...  args 
)
inlineprotected

Create an Optional_Base object whose contained value is initialized from the specified args. Use the specified allocator to supply memory.

◆ Optional_Base() [17/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( BloombergLP::bslstl::Optional_ConstructFromForwardRef  ,
BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)  value 
)
inline

◆ Optional_Base() [18/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional  ,
BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >)  original,
BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR(t_TYPE, t_ANY_TYPE)   
)
inline

◆ Optional_Base() [19/19]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
template<class t_ANY_TYPE >
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::Optional_Base ( BloombergLP::bslstl::Optional_MoveConstructFromOtherOptional  ,
BSLMF_MOVABLEREF_DEDUCE(Optional_Base< t_ANY_TYPE >)  original,
BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(t_TYPE, t_ANY_TYPE)   
)
inline

Member Function Documentation

◆ assignOrEmplace()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
void bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::assignOrEmplace ( BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)  rhs)
protected

If *this holds an object, assign to that object the value of the specified rhs, converted to t_TYPE. Otherwise, construct a held object from rhs, converted to t_TYPE. The allocators of *this and rhs remain unchanged.

◆ BSLMF_NESTED_TRAIT_DECLARATION() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION ( Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >  ,
BloombergLP::bslma::UsesBslmaAllocator   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION ( Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >  ,
BloombergLP::bslmf::UsesAllocatorArgT   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >  ,
BloombergLP::bslmf::IsBitwiseCopyable  ,
BloombergLP::bslmf::IsBitwiseCopyable< t_TYPE >::value   
)

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >  ,
BloombergLP::bslmf::IsBitwiseMoveable  ,
BloombergLP::bslmf::IsBitwiseMoveable< t_TYPE >::value   
)

◆ dereferenceRaw() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::dereferenceRaw ( )
protected

Return a reference providing modifiable access to the underlying t_TYPE object. The behavior is undefined if the Optional_Base object is disengaged. Note that this function is only intended to be called by bdlb::NullableValue::value during transition of its implementation to use 'bsl::Optional_Base. Note that ref-qualified versions of value() are not provided because NullableValue does not require them.

◆ dereferenceRaw() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
const t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::dereferenceRaw ( ) const
protected

Return a reference providing non-modifiable access to the underlying t_TYPE object. The behavior is undefined if the Optional_Base object is disengaged. Note that this function is only intended to be called by bdlb::NullableValue::value during transition of its implementation to use 'bsl::Optional_Base. Note that ref-qualified versions of value() are not provided because NullableValue does not require them.

◆ emplace()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class... t_ARGS>
t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::emplace ( BSLS_COMPILERFEATURES_FORWARD_REF(t_ARGS)...  args)
inline

Assign to this Optional_Base object the value of the (template parameter) t_TYPE created in place using the specified args and return a reference providing modifiable access to the underlying t_TYPE object. If this Optional_Base object already contains an object (true == hasValue()), that object is destroyed before the new object is created. The allocator specified at the construction of this Optional_Base object is used to supply memory to the value object. Attempts to explicitly specify via args another allocator to supply memory to the created (value) object are disallowed by the compiler. Note that if the constructor of t_TYPE throws an exception this object is left in a disengaged state.

◆ get_allocator()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::allocator_type bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::get_allocator ( ) const
inline

◆ has_value()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
bool bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::has_value ( ) const
inline

◆ operator UnspecifiedBool()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator UnspecifiedBool ( ) const
inline

◆ operator*() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator* ( )
inline

◆ operator*() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
const t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator* ( ) const
inline

◆ operator->() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
t_TYPE * bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator-> ( )
inline

Return a pointer providing modifiable access to the underlying t_TYPE object. The behavior is undefined if the Optional_Base object is disengaged.

◆ operator->() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
const t_TYPE * bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator-> ( ) const
inline

Return a pointer providing non-modifiable access to the underlying t_TYPE object. The behavior is undefined if the Optional_Base object is disengaged.

◆ operator=() [1/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator= ( BloombergLP::bslmf::MovableRef< Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > >  rhs)
inline

Assign to this object the value of the specified rhs object, and return a non-const reference to this object. The allocators of this object and rhs both remain unchanged. The contents of rhs are either move-constructed into or move-assigned to this object. rhs is left in a valid but unspecified state.

◆ operator=() [2/2]

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::operator= ( const Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC > &  rhs)
inline

Assign to this object the value of the specified rhs object, and return a non-const reference to this object.

◆ reset()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
void bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::reset ( )
inline

Reset this object to the default constructed state (i.e., to a disengaged state).

◆ value()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC = BloombergLP::bslma::UsesBslmaAllocator<t_TYPE>::value>
const t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::value ( ) const

◆ value_or()

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
template<class t_ANY_TYPE >
t_TYPE bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::value_or ( BSLS_COMPILERFEATURES_FORWARD_REF(t_ANY_TYPE)  value) const
inline

Member Data Documentation

◆ value

template<class t_TYPE , bool t_USES_BSLMA_ALLOC>
const t_TYPE & bslstl::Optional_Base< t_TYPE, t_USES_BSLMA_ALLOC >::value
inline

The documentation for this class was generated from the following file: