ARB
Classes | Namespaces | Macros | Typedefs | Functions
downcast.h File Reference
#include <arb_assert.h>
#include "static_assert.h"
Include dependency graph for downcast.h:

Go to the source code of this file.

Classes

struct  ARB_type_traits::remove_const< T >
 
struct  ARB_type_traits::remove_const< const T >
 
struct  ARB_type_traits::remove_volatile< T >
 
struct  ARB_type_traits::remove_volatile< volatile T >
 
struct  ARB_type_traits::remove_cv< T >
 
struct  ARB_type_traits::Host< B, D >
 
struct  ARB_type_traits::is_base_of< B, D >
 
struct  ARB_type_traits::is_same< T, U >
 
struct  dereference< typename >
 
struct  dereference< T * >
 
struct  dereference< T *const >
 

Namespaces

 ARB_type_traits
 

Macros

#define DOWNCAST(totype, expr)   static_downcast<totype,typeof(expr)>(expr)
 
#define DEFINE_DOWNCAST_ACCESSORS(CLASS, NAME, VALUE)
 
#define DOWNCAST_REFERENCE(totype, expr)   (*DOWNCAST(totype*, &(expr)))
 

Typedefs

typedef char(& ARB_type_traits::yes )[1]
 
typedef char(& ARB_type_traits::no )[2]
 

Functions

template<class DERIVED_PTR , class BASE_PTR >
DERIVED_PTR static_downcast (BASE_PTR expr)
 

Macro Definition Documentation

#define DOWNCAST (   totype,
  expr 
)    static_downcast<totype,typeof(expr)>(expr)
#define DEFINE_DOWNCAST_ACCESSORS (   CLASS,
  NAME,
  VALUE 
)
Value:
CLASS *NAME() { return DOWNCAST(CLASS*, VALUE); } \
const CLASS *NAME() const { return DOWNCAST(const CLASS*, VALUE); }
#define DOWNCAST(totype, expr)
Definition: downcast.h:141

Definition at line 147 of file downcast.h.

#define DOWNCAST_REFERENCE (   totype,
  expr 
)    (*DOWNCAST(totype*, &(expr)))

Function Documentation

template<class DERIVED_PTR , class BASE_PTR >
DERIVED_PTR static_downcast ( BASE_PTR  expr)
inline

Definition at line 135 of file downcast.h.