Imported Upstream version 1.72.0
[platform/upstream/boost.git] / boost / histogram / detail / limits.hpp
1 // Copyright 2015-2019 Hans Dembinski
2 //
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #ifndef BOOST_HISTOGRAM_DETAIL_LIMITS_HPP
8 #define BOOST_HISTOGRAM_DETAIL_LIMITS_HPP
9
10 #include <limits>
11
12 namespace boost {
13 namespace histogram {
14 namespace detail {
15
16 template <typename T>
17 constexpr T lowest() {
18   return std::numeric_limits<T>::lowest();
19 }
20
21 template <>
22 constexpr double lowest() {
23   return -std::numeric_limits<double>::infinity();
24 }
25
26 template <>
27 constexpr float lowest() {
28   return -std::numeric_limits<float>::infinity();
29 }
30
31 template <typename T>
32 constexpr T highest() {
33   return (std::numeric_limits<T>::max)();
34 }
35
36 template <>
37 constexpr double highest() {
38   return std::numeric_limits<double>::infinity();
39 }
40
41 template <>
42 constexpr float highest() {
43   return std::numeric_limits<float>::infinity();
44 }
45
46 } // namespace detail
47 } // namespace histogram
48 } // namespace boost
49
50 #endif