orxonox::ImplicitConversion< FromType, ToType > Class Template Reference

Detects whether you can implicitely cast FromType to ToType. More...

#include <src/util/TemplateUtils.h>

List of all members.

Public Types

enum  { exists = (sizeof(test(object)) == sizeof(char)) }

Private Member Functions

 ImplicitConversion (const ImplicitConversion &)
 ImplicitConversion ()
 ~ImplicitConversion ()

Static Private Member Functions

static long long test (...)
static char test (ToType)

Static Private Attributes

static FromType object


Detailed Description

template<class FromType, class ToType>
class orxonox::ImplicitConversion< FromType, ToType >

Detects whether you can implicitely cast FromType to ToType.

Usage: ImplicitConversion<FromType, ToType>::exists This gives you a compile time constant boolean in the form of an enum value.

Note:
The idea to use the sizeof() operator on return values to determine function existance is described in 'Modern C++ design' by Alexandrescu (2001).

Member Enumeration Documentation

template<class FromType, class ToType>
anonymous enum

Enumerator:
exists 


Constructor & Destructor Documentation

template<class FromType, class ToType>
orxonox::ImplicitConversion< FromType, ToType >::ImplicitConversion (  )  [private]

template<class FromType, class ToType>
orxonox::ImplicitConversion< FromType, ToType >::ImplicitConversion ( const ImplicitConversion< FromType, ToType > &   )  [private]

template<class FromType, class ToType>
orxonox::ImplicitConversion< FromType, ToType >::~ImplicitConversion (  )  [private]


Member Function Documentation

template<class FromType, class ToType>
static long long orxonox::ImplicitConversion< FromType, ToType >::test (   ...  )  [static, private]

template<class FromType, class ToType>
static char orxonox::ImplicitConversion< FromType, ToType >::test ( ToType   )  [static, private]


Member Data Documentation

template<class FromType, class ToType>
FromType orxonox::ImplicitConversion< FromType, ToType >::object [static, private]


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

Generated on Tue Jul 28 16:22:37 2009 for Orxonox by  doxygen 1.5.6