Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
limit.h
Go to the documentation of this file.
1 #pragma once
2 
7 #include "basedef.h"
8 #include <limits>
9 
10 #ifdef _WIN32
11 # pragma warning(disable:4146)
12 #endif
13 
14 #ifdef __LINUX
15 #include <math.h>
16 #endif
17 
24 template <class T>
25 class limits : public std::numeric_limits<T> {
26 public:
31  static T real_min() {
33  return min_val;
34  }
35 };
36 template <class T>
37 constexpr T initVal() { return limits<T>::max(); }
38 template <>
39 constexpr double initVal<double>() { return limits<double>::quiet_NaN(); }
40 template <>
41 constexpr float initVal<float>() { return limits<float>::quiet_NaN(); }
42 
43 
44 #ifdef _WIN32
45 # pragma warning(default:4146)
46 #endif
47 
49 // EoF
static T real_min()
Definition: limit.h:31
debug checked shorthand for std::numeric_limits<T>::
Definition: limit.h:25
Base type definitions - if QT is not in use.