Quick Links:

bal | bbl | bdl | bsl

Static Public Member Functions

bdlb::Variant_ReturnAnyTypeUtil< TYPE > Struct Template Reference

#include <bdlb_variant.h>

List of all members.

Static Public Member Functions

static TYPE doNotCall (TYPE *dummy)
static TYPE doNotCall ()

Detailed Description

template<class TYPE>
struct bdlb::Variant_ReturnAnyTypeUtil< TYPE >

This struct provides a function that returns an (invalid) instance of any type. It is meant to allow clients to express:

      template <RESULT_TYPE>
      RESULT_TYPE foo()
      {
          // ...
    
          // The following 'return' is unreachable, but is required for
          // compilation.
    
          return Variant_ReturnAnyTypeUtil::doNotCall();
      }

where RESULT_TYPE may be void. Note that while such a return statement is not required by the C++ standard, the lack of such a return statement causes a warning (or error) with many compilers.

See Component bdlb_variant


Member Function Documentation

template<class TYPE >
static TYPE bdlb::Variant_ReturnAnyTypeUtil< TYPE >::doNotCall ( TYPE *  dummy  )  [static]

Return the specified *dummy.

template<class TYPE >
static TYPE bdlb::Variant_ReturnAnyTypeUtil< TYPE >::doNotCall (  )  [static]

Return a TYPE object.


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