Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::IsBaseOf< Base, Derived > Struct Template Reference

IsBaseOf is similar to std::is_base_of. More...

#include "type_structs.h"

Collaboration diagram for ion::base::IsBaseOf< Base, Derived >:

Classes

struct  Helper
 Because the Derived type-cast operator is non-const, it is preferred over the Base operator when calling Test() below. More...
 

Static Public Member Functions

template<typename T >
static char Test (Derived *, T)
 Overloaded function that chooses the Derived version iff Derived is actually derived from Base. More...
 
static int Test (Base *, int)
 

Static Public Attributes

static const bool value = sizeof(Test(Helper(), 0)) == 1
 

Detailed Description

template<typename Base, typename Derived>
struct ion::base::IsBaseOf< Base, Derived >

IsBaseOf is similar to std::is_base_of.

IsBaseOf<Base, Derived>::value is true iff Base and Derived are different types and Base is a base class of Derived.

Definition at line 45 of file type_structs.h.

Member Function Documentation

template<typename Base , typename Derived >
template<typename T >
static char ion::base::IsBaseOf< Base, Derived >::Test ( Derived *  ,
T   
)
static

Overloaded function that chooses the Derived version iff Derived is actually derived from Base.

The size of the return type is used to tell which version is selected.

template<typename Base , typename Derived >
static int ion::base::IsBaseOf< Base, Derived >::Test ( Base *  ,
int   
)
static

Member Data Documentation

template<typename Base , typename Derived >
const bool ion::base::IsBaseOf< Base, Derived >::value = sizeof(Test(Helper(), 0)) == 1
static

Definition at line 57 of file type_structs.h.


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