FE 0.6.0
A header-only C++ library for writing frontends
|
Inherit from this class using CRTP, for some nice dynamic_cast
-style wrappers.
More...
#include <fe/cast.h>
Public Member Functions | |
template<class T > | |
T * | as () |
static_cast with debug check. | |
template<class T > | |
T * | isa () |
dynamic_cast . | |
template<class T , class U > | |
B * | isa () |
Yields B* if it is either T or U and `nullptr* otherwise. | |
template<class T > | |
const T * | as () const |
const version. | |
template<class T > | |
const T * | isa () const |
const version. | |
template<class T , class U > | |
const B * | isa () const |
const version. | |
Inherit from this class using CRTP, for some nice dynamic_cast
-style wrappers.
static_cast
with debug check.
Definition at line 19 of file cast.h.
References fe::RuntimeCast< B >::isa().
Referenced by fe::RuntimeCast< B >::as().
dynamic_cast
.
If T
isa fe::Nodeable, it will use node()
, otherwise a dynamic_cast
.
Definition at line 24 of file cast.h.
Referenced by fe::RuntimeCast< B >::as(), fe::RuntimeCast< B >::isa(), and fe::RuntimeCast< B >::isa().
Yields B*
if it is either T
or U
and `nullptr* otherwise.
Definition at line 33 of file cast.h.
References fe::RuntimeCast< B >::isa().
|
inline |