Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslstl::Optional_Data< TYPE, IS_TRIVIALLY_DESTRUCTIBLE > Struct Template Reference

#include <bslstl_optional.h>

Inheritance diagram for bslstl::Optional_Data< TYPE, IS_TRIVIALLY_DESTRUCTIBLE >:
bslstl::Optional_DataImp< TYPE >

List of all members.

Public Member Functions

 ~Optional_Data ()
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

Detailed Description

template<class TYPE, bool IS_TRIVIALLY_DESTRUCTIBLE = bslstl::Optional_IsTriviallyDestructible<TYPE>::value>
struct bslstl::Optional_Data< TYPE, IS_TRIVIALLY_DESTRUCTIBLE >

This component-private struct manages a value_type object in optional by inheriting from `Optional_DataImp`. In addition, this primary template properly destroys the owned instance of TYPE in its destructor.

See Component bslstl_optional


Constructor & Destructor Documentation

template<class TYPE , bool IS_TRIVIALLY_DESTRUCTIBLE = bslstl::Optional_IsTriviallyDestructible<TYPE>::value>
bslstl::Optional_Data< TYPE, IS_TRIVIALLY_DESTRUCTIBLE >::~Optional_Data (  ) 

Destroy the managed value_type object, if it exists.


Member Function Documentation

template<class TYPE >
template<class... ARGS>
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.

template<class TYPE >
template<class INIT_LIST_TYPE , class... ARGS>
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.

template<class TYPE >
void bslstl::Optional_DataImp< TYPE >::reset (  )  [inherited]

Destroy the value_type object in d_buffer, if any.

template<class TYPE >
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.

template<class TYPE >
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.

template<class TYPE >
bool bslstl::Optional_DataImp< TYPE >::hasValue (  )  const [inherited]

Return true if this objects has a value, and false otherwise.


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