ALPSCore reference
inf.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 #ifndef ALPS_NUMERIC_INF_HEADER
8 #define ALPS_NUMERIC_INF_HEADER
9 
11 
12 #include <limits>
13 
14 namespace alps {
15  namespace numeric {
16 
17  template<typename T> struct inf {};
18 
19 #define ALPS_NUMERIC_INF_OVERLOADS(T) \
20  \
21  template<> struct inf< T > { \
22  \
23  inf<T>(const T&) {} \
24  \
25  \
26  operator T () const { \
27  return std::numeric_limits< T >::infinity(); \
28  } \
29  };
32  ALPS_NUMERIC_INF_OVERLOADS(alps::detail::type_wrapper<long double>::type)
33 #undef ALPS_NUMERIC_INF_OVERLOADS
34 
35  }
36 }
37 
38 #endif
#define ALPS_NUMERIC_INF_OVERLOADS(T)
Definition: inf.hpp:19