BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl::Variant_ImpUtil Struct Reference

#include <bslstl_variant.h>

Static Public Member Functions

template<class t_RET , size_t t_INDEX, class t_VARIANT >
static t_RET & get (t_VARIANT &variant)
 
template<class t_RET , size_t t_INDEX, class t_VARIANT >
static t_RET & get (const t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
static t_RET visit (t_VISITOR &visitor, t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
static t_RET visit (t_VISITOR &visitor, const t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
static t_RET moveVisit (t_VISITOR &visitor, t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
static t_RET visitId (t_VISITOR &visitor, t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
static t_RET visitId (t_VISITOR &visitor, const t_VARIANT &variant)
 
template<class t_RET , size_t t_INDEX, class t_VARIANT >
static t_RET & unsafeGet (t_VARIANT &variant)
 
template<class t_RET , size_t t_INDEX, class t_VARIANT >
static t_RET & unsafeGet (const t_VARIANT &variant)
 
template<class t_TYPE , class t_VARIANT >
static t_TYPE & unsafeGet (t_VARIANT &obj)
 
template<class t_TYPE , class t_VARIANT >
static const t_TYPE & unsafeGet (const t_VARIANT &obj)
 
template<class t_RET , class t_VARIANT_UNION >
static t_RET & getAlternative (bsl::in_place_index_t< 0 >, t_VARIANT_UNION &variantUnion) BSLS_KEYWORD_NOEXCEPT
 
template<class t_RET , size_t t_INDEX, class t_VARIANT_UNION >
static t_RET & getAlternative (bsl::in_place_index_t< t_INDEX >, t_VARIANT_UNION &variantUnion) BSLS_KEYWORD_NOEXCEPT
 
template<class t_VARIANT >
static bool Equal (const t_VARIANT &lhs, const t_VARIANT &rhs)
 
template<class t_VARIANT >
static bool NotEqual (const t_VARIANT &lhs, const t_VARIANT &rhs)
 
template<class t_VARIANT >
static bool LessThan (const t_VARIANT &lhs, const t_VARIANT &rhs)
 
template<class t_VARIANT >
static bool GreaterThan (const t_VARIANT &lhs, const t_VARIANT &rhs)
 
template<class t_VARIANT >
static bool LessOrEqual (const t_VARIANT &lhs, const t_VARIANT &rhs)
 
template<class t_VARIANT >
static bool GreaterOrEqual (const t_VARIANT &lhs, const t_VARIANT &rhs)
 

Detailed Description

This struct provides a namespace for utility functions used implement various operations on bsl::variant.

Member Function Documentation

◆ Equal()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::Equal ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

◆ get() [1/2]

template<class t_RET , size_t t_INDEX, class t_VARIANT >
t_RET & bslstl::Variant_ImpUtil::get ( const t_VARIANT &  variant)
static

◆ get() [2/2]

template<class t_RET , size_t t_INDEX, class t_VARIANT >
t_RET & bslstl::Variant_ImpUtil::get ( t_VARIANT &  variant)
static

Return a reference to the alternative with index (template parameter) t_INDEX in the specified variant. If t_INDEX is not the index of the currently active alternative, throw an exception of type bad_variant_access. Note that the return type must be explicitly specified.

◆ getAlternative() [1/2]

template<class t_RET , class t_VARIANT_UNION >
t_RET & bslstl::Variant_ImpUtil::getAlternative ( bsl::in_place_index_t< 0 >  ,
t_VARIANT_UNION &  variantUnion 
)
static

Return a reference to the object managed by the first member of the specified variantUnion. It is the base case for the overload of getAlternative below. This function does not require friend access to Variant and has been added to Variant_ImpUtil for the purposes of avoiding free functions.

◆ getAlternative() [2/2]

template<class t_RET , size_t t_INDEX, class t_VARIANT_UNION >
t_RET & bslstl::Variant_ImpUtil::getAlternative ( bsl::in_place_index_t< t_INDEX >  ,
t_VARIANT_UNION &  variantUnion 
)
static

Return a reference to the alternative with index (template parameter) t_INDEX in the specified variantUnion by recursively unravelling variantUnion until the desired alternative is at the head. t_INDEX shall be a valid alternative index. The behavior is undefined unless the alternative with index t_INDEX has the same type as the active alternative of variantUnion. This function does not require friend access to Variant and has been added to Variant_ImpUtil for the purposes of avoiding free functions.

◆ GreaterOrEqual()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::GreaterOrEqual ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

Return the result of comparing the specified lhs with the specified rhs. The behavior is undefined unless both lhs and rhs hold the same alternative. Note that the capitalization of the names of these methods has been chosen so that their definitions can be generated using a macro.

◆ GreaterThan()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::GreaterThan ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

◆ LessOrEqual()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::LessOrEqual ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

◆ LessThan()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::LessThan ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

◆ moveVisit()

template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bslstl::Variant_ImpUtil::moveVisit ( t_VISITOR &  visitor,
t_VARIANT &  variant 
)
static

◆ NotEqual()

template<class t_VARIANT >
static bool bslstl::Variant_ImpUtil::NotEqual ( const t_VARIANT &  lhs,
const t_VARIANT &  rhs 
)
static

◆ unsafeGet() [1/4]

template<class t_TYPE , class t_VARIANT >
const t_TYPE & bslstl::Variant_ImpUtil::unsafeGet ( const t_VARIANT &  obj)
static

◆ unsafeGet() [2/4]

template<class t_RET , size_t t_INDEX, class t_VARIANT >
t_RET & bslstl::Variant_ImpUtil::unsafeGet ( const t_VARIANT &  variant)
static

◆ unsafeGet() [3/4]

template<class t_TYPE , class t_VARIANT >
t_TYPE & bslstl::Variant_ImpUtil::unsafeGet ( t_VARIANT &  obj)
static

◆ unsafeGet() [4/4]

template<class t_RET , size_t t_INDEX, class t_VARIANT >
t_RET & bslstl::Variant_ImpUtil::unsafeGet ( t_VARIANT &  variant)
static

◆ visit() [1/2]

template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bslstl::Variant_ImpUtil::visit ( t_VISITOR &  visitor,
const t_VARIANT &  variant 
)
static

◆ visit() [2/2]

template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bslstl::Variant_ImpUtil::visit ( t_VISITOR &  visitor,
t_VARIANT &  variant 
)
static

◆ visitId() [1/2]

template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bslstl::Variant_ImpUtil::visitId ( t_VISITOR &  visitor,
const t_VARIANT &  variant 
)
static

◆ visitId() [2/2]

template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bslstl::Variant_ImpUtil::visitId ( t_VISITOR &  visitor,
t_VARIANT &  variant 
)
static

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