openMSX
Functions
checked_cast.hh File Reference
#include <type_traits>
#include <cassert>
Include dependency graph for checked_cast.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename TO , typename FROM >
constexpr TO checked_cast (FROM *from)
 Based on checked_cast implementation from the book: C++ Coding Standard item 93: Avoid using static_cast on pointers.
 
template<typename TO , typename FROM >
constexpr TO checked_cast (FROM &from)
 

Function Documentation

◆ checked_cast() [1/2]

template<typename TO , typename FROM >
constexpr TO checked_cast ( FROM &  from)
constexpr

Definition at line 20 of file checked_cast.hh.

◆ checked_cast() [2/2]

template<typename TO , typename FROM >
constexpr TO checked_cast ( FROM *  from)
constexpr

Based on checked_cast implementation from the book: C++ Coding Standard item 93: Avoid using static_cast on pointers.

Definition at line 14 of file checked_cast.hh.