Itasca C++ Interface
Loading...
Searching...
No Matches
Functions
to.h File Reference

A overflow checked shorthand for static_cast<T>(). More...

#include "limit.h"
#include <cassert>
#include <stdexcept>

Go to the source code of this file.

Functions

template<class D , class T >
constexpr D to (const T &t)
 This template function serves as an alternative to static_cast<T>().
 
template<>
constexpr float to (const double &t)
 
template<class D >
constexpr D to (const double &d)
 
template<class D >
D constexpr to (const float &d)
 
template<>
constexpr double to (const float &d)
 
template<class D , class T >
D * check_cast (T *t)
 This template function serves as a fast alternative to dynamic_cast, when you know the base offset is the same.
 
template<class D , class T >
const D * check_cast (const T *t)
 This template function serves as a fast alternative to dynamic_cast, when you know the base offset is the same.
 
template<class T >
constexpr const T safeDiv (const T num, const T denom)
 This function provids "safe" division operation, checks explicitly for zero.
 

Detailed Description

A overflow checked shorthand for static_cast<T>().