Quick Links: |
#include <bslstl_optional.h>
Public Member Functions | |
template<class... ARGS> | |
TYPE & | emplace (bslma::Allocator *allocator, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) |
template<class INIT_LIST_TYPE , class... ARGS> | |
TYPE & | emplace (bslma::Allocator *allocator, std::initializer_list< INIT_LIST_TYPE > initializer_list, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) |
void | reset () BSLS_KEYWORD_NOEXCEPT |
TYPE & | value () |
const TYPE & | value () const |
bool | hasValue () const BSLS_KEYWORD_NOEXCEPT |
This partial specialization manages a trivially destructible value_type
in optional. It does not have a user-provided destructor, which makes it is_trivially_destructible
itself.
TYPE& bslstl::Optional_DataImp< TYPE >::emplace | ( | bslma::Allocator * | allocator, | |
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [inherited] |
Create an object of StoredType
in d_buffer
using the specified allocator
and arguments and return a reference providing modifiable access to the underlying TYPE
object.
TYPE& bslstl::Optional_DataImp< TYPE >::emplace | ( | bslma::Allocator * | allocator, | |
std::initializer_list< INIT_LIST_TYPE > | initializer_list, | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [inherited] |
Create an object of StoredType
in d_buffer
using the specified allocator
, initializer_list
and arguments, and return a reference providing modifiable access to the underlying TYPE
object.
void bslstl::Optional_DataImp< TYPE >::reset | ( | ) | [inherited] |
Destroy the value_type
object in d_buffer
, if any.
TYPE& bslstl::Optional_DataImp< TYPE >::value | ( | ) | [inherited] |
Return the value_type
object in d_buffer
with const qualification adjusted to match that of TYPE
. The behavior is undefined unless this->hasValue() == true
.
const TYPE& bslstl::Optional_DataImp< TYPE >::value | ( | ) | const [inherited] |
Return the value_type
object in d_buffer
with const qualification adjusted to match that of TYPE
. The behavior is undefined unless this->hasValue() == true
.
bool bslstl::Optional_DataImp< TYPE >::hasValue | ( | ) | const [inherited] |
Return true
if this objects has a value, and false
otherwise.