Rosetta Protocols  2014.35
Namespaces | Classes | Functions
protocols::jd2::utility Namespace Reference

Namespaces

 pointer
 

Classes

struct  RawType
 Meta-programming classes to provide the pointer type for down_cast. More...
 
struct  RawType< T & >
 
struct  RawType< T * >
 

Functions

template<class Target , class Source >
Target down_cast (Source &s)
 Fast assert-checked polymorphic down-cast: reference argument. More...
 
template<class Target , class Source >
Target down_cast (Source *p)
 Fast assert-checked polymorphic down-cast: pointer argument. More...
 

Function Documentation

template<class Target , class Source >
Target protocols::jd2::utility::down_cast ( Source &  s)
inline

Fast assert-checked polymorphic down-cast: reference argument.

Note
Usage: down_cast< Type & > where Type can be const-qualified
For down-casting when you know the cast is valid
Can't use for hierarchies with virtual base classes
Assert intentionally won't compile if a virtual base class is present
template<class Target , class Source >
Target protocols::jd2::utility::down_cast ( Source *  p)
inline

Fast assert-checked polymorphic down-cast: pointer argument.

Note
Usage: down_cast< Type * > where Type can be const-qualified
For down-casting when you know the cast is valid
Can't use for hierarchies with virtual base classes
Assert intentionally won't compile if a virtual base class is present