Itasca C++ Interface
Loading...
Searching...
No Matches
Classes | 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.

Classes

struct  set_constness_of< T >
 
struct  set_constness_of< T >::by< U >
 

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 >
PUSHWARNING constexpr const T safeDiv (const T num, const T denom, const T safeVal=0)
 This function provids "safe" division operation, checks explicitly for zero.
 

Detailed Description

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