BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR > Class Template Reference

#include <bdlb_variant.h>

Public Member Functions

 Variant_RawVisitorHelper (VISITOR *visitor)
 
template<class ARGUMENT_TYPE >
RESULT_TYPE operator() (ARGUMENT_TYPE &argument)
 
template<class ARGUMENT_TYPE >
RESULT_TYPE operator() (const ARGUMENT_TYPE &argument)
 
template<class ARGUMENT_TYPE >
RESULT_TYPE operator() (ARGUMENT_TYPE &argument) const
 
template<class ARGUMENT_TYPE >
RESULT_TYPE operator() (const ARGUMENT_TYPE &argument) const
 
RESULT_TYPE operator() (bslmf::Nil) const
 Do not call. The behavior of this method is undefined.
 

Detailed Description

template<class RESULT_TYPE, class VISITOR>
class bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >

This struct provides a helper for implementing Variant::applyRaw that enables applyRaw to support visitor functors that do not provide an overload for operator()(bslmf::Nil). Objects of this type are constructed using a functor of (template parameter) type VISITOR, whose operator() returns the (template parameter) type RESULT_TYPE. A Variant_RawVisitorHelper wraps a functor of type VISITOR and provides an implementation of operator()(bslmf::Nil) that performs a BSLS_ASSERT_OPT(false). Note that this overload is needed to enable compilation (specifically, to instantiate doApply and doApplyR), but is never invoked by any code path at runtime.

See bdlb_variant

Constructor & Destructor Documentation

◆ Variant_RawVisitorHelper()

template<class RESULT_TYPE , class VISITOR >
bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::Variant_RawVisitorHelper ( VISITOR *  visitor)
inlineexplicit

Create a RawVisitorHelper functor that delegates to the specified visitor.

Member Function Documentation

◆ operator()() [1/5]

template<class RESULT_TYPE , class VISITOR >
template<class ARGUMENT_TYPE >
RESULT_TYPE bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::operator() ( ARGUMENT_TYPE &  argument)
inline

Invoke the functor supplied at construction with the specified argument, and return the result.

◆ operator()() [2/5]

template<class RESULT_TYPE , class VISITOR >
template<class ARGUMENT_TYPE >
RESULT_TYPE bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::operator() ( ARGUMENT_TYPE &  argument) const
inline

Invoke the functor supplied at construction with the specified argument, and return the result.

◆ operator()() [3/5]

template<class RESULT_TYPE , class VISITOR >
RESULT_TYPE bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::operator() ( bslmf::Nil  ) const

◆ operator()() [4/5]

template<class RESULT_TYPE , class VISITOR >
template<class ARGUMENT_TYPE >
RESULT_TYPE bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::operator() ( const ARGUMENT_TYPE &  argument)
inline

◆ operator()() [5/5]

template<class RESULT_TYPE , class VISITOR >
template<class ARGUMENT_TYPE >
RESULT_TYPE bdlb::Variant_RawVisitorHelper< RESULT_TYPE, VISITOR >::operator() ( const ARGUMENT_TYPE &  argument) const
inline

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