LvArray
Classes | Namespaces | Functions | Variables
limits.hpp File Reference

Contains portable access to std::numeric_limits and functions for converting between integral types. More...

#include "Macros.hpp"
#include <limits>
Include dependency graph for limits.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LvArray::NumericLimits< T >
 A wrapper for the std::numeric_limits< T > member functions, this allows their values to be used on device. More...
 
struct  LvArray::NumericLimitsNC< T >
 The same as NumericLimits except the entries are not static or constexpr. More...
 

Namespaces

 LvArray
 The top level namespace.
 

Functions

template<typename OUTPUT , typename INPUT >
std::enable_if_t< internal::canEasilyConvert< INPUT, OUTPUT >, OUTPUT > constexpr LVARRAY_HOST_DEVICE LvArray::integerConversion (INPUT input)
 
template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > &&std::is_unsigned< INPUT >::value, OUTPUT > LVARRAY_HOST_DEVICE LvArray::integerConversion (INPUT input)
 
template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > &&!std::is_unsigned< INPUT >::value, OUTPUT > LVARRAY_HOST_DEVICE LvArray::integerConversion (INPUT input)
 

Variables

template<typename T , typename U >
constexpr bool LvArray::internal::sameSignedness
 True iff. More...
 
template<typename INPUT , typename OUTPUT >
constexpr bool LvArray::internal::canEasilyConvert
 True iff. More...
 

Detailed Description

Contains portable access to std::numeric_limits and functions for converting between integral types.

Variable Documentation

◆ canEasilyConvert

template<typename INPUT , typename OUTPUT >
constexpr bool LvArray::internal::canEasilyConvert
Initial value:
= sizeof( INPUT ) < sizeof( OUTPUT ) ||
( sizeof( INPUT ) == sizeof( OUTPUT ) && sameSignedness< INPUT, OUTPUT > )

True iff.

Template Parameters
INPUTThe input type.
OUTPUTThe output type.
OUTPUTcan hold every possible value of
INPUT.

◆ sameSignedness

template<typename T , typename U >
constexpr bool LvArray::internal::sameSignedness
Initial value:
= ( std::is_signed< T >::value && std::is_signed< U >::value ) ||
( std::is_unsigned< T >::value && std::is_unsigned< U >::value )

True iff.

Template Parameters
TThe first type to check.
UThe second type to check.
Tand
Uare both signed or both unsigned.