FE 0.5.0
A header-only C++ library for writing frontends
Loading...
Searching...
No Matches
fe::RuntimeCast< B > Class Template Reference

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.
 

Detailed Description

template<class B>
class fe::RuntimeCast< B >

Inherit from this class using CRTP, for some nice dynamic_cast-style wrappers.

Definition at line 15 of file cast.h.

Member Function Documentation

◆ as() [1/2]

template<class B >
template<class T >
T * fe::RuntimeCast< B >::as ( )
inline

static_cast with debug check.

Definition at line 19 of file cast.h.

◆ as() [2/2]

template<class B >
template<class T >
const T * fe::RuntimeCast< B >::as ( ) const
inline

const version.

Definition at line 35 of file cast.h.

◆ isa() [1/4]

template<class B >
template<class T >
T * fe::RuntimeCast< B >::isa ( )
inline

dynamic_cast.

If T isa fe::Nodeable, it will use node(), otherwise a dynamic_cast.

Definition at line 24 of file cast.h.

◆ isa() [2/4]

template<class B >
template<class T , class U >
B * fe::RuntimeCast< B >::isa ( )
inline

Yields B* if it is either T or U and `nullptr* otherwise.

Definition at line 33 of file cast.h.

◆ isa() [3/4]

template<class B >
template<class T >
const T * fe::RuntimeCast< B >::isa ( ) const
inline

const version.

Definition at line 36 of file cast.h.

◆ isa() [4/4]

template<class B >
template<class T , class U >
const B * fe::RuntimeCast< B >::isa ( ) const
inline

const version.

Definition at line 37 of file cast.h.


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