Phi
is_safe_floating_point.hpp
1 #ifndef INCG_PHI_CORE_TYPE_TRAITS_IS_SAFE_FLOATING_POINT_HPP
2 #define INCG_PHI_CORE_TYPE_TRAITS_IS_SAFE_FLOATING_POINT_HPP
3 
4 #include "phi/phi_config.hpp"
5 
6 #if PHI_HAS_EXTENSION_PRAGMA_ONCE()
7 # pragma once
8 #endif
9 
10 #include "phi/compiler_support/constexpr.hpp"
11 #include "phi/compiler_support/inline_variables.hpp"
12 #include "phi/type_traits/integral_constant.hpp"
13 #include "phi/type_traits/remove_cv.hpp"
14 
15 DETAIL_PHI_BEGIN_NAMESPACE()
16 
17 template <typename TypeT>
18 class floating_point;
19 
20 namespace detail
21 {
22  template <typename TypeT>
24  {};
25 
26  template <typename TypeT>
27  struct is_safe_floating_point_impl<floating_point<TypeT>> : public true_type
28  {};
29 } // namespace detail
30 
31 template <typename TypeT>
33 {};
34 
35 template <typename TypeT>
37  : public integral_constant<bool, !is_safe_floating_point<TypeT>::value>
38 {};
39 
40 #if PHI_HAS_FEATURE_VARIABLE_TEMPLATE()
41 
42 template <typename TypeT>
43 PHI_INLINE_VARIABLE PHI_CONSTEXPR bool is_safe_floating_point_v =
45 
46 template <typename TypeT>
47 PHI_INLINE_VARIABLE PHI_CONSTEXPR bool is_not_safe_floating_point_v =
49 
50 #endif
51 
52 DETAIL_PHI_END_NAMESPACE()
53 
54 #endif // INCG_PHI_CORE_TYPE_TRAITS_IS_SAFE_FLOATING_POINT_HPP
Definition: integral_constant.hpp:19
Definition: is_safe_floating_point.hpp:32
Definition: swap.hpp:23
Definition: is_safe_floating_point.hpp:23
Definition: floating_point.hpp:55
Definition: is_safe_floating_point.hpp:36