7 #if !defined(CNL_IMPL_NUM_TRAITS_TO_REP_H)
8 #define CNL_IMPL_NUM_TRAITS_TO_REP_H
10 #include "../../constant.h"
11 #include "../type_traits/remove_cvref.h"
14 #include <type_traits>
19 template<
typename Number>
20 struct default_to_rep {
21 [[nodiscard]] constexpr
auto& operator()(Number& n)
const
25 [[nodiscard]] constexpr
auto const& operator()(Number
const& n)
const
29 [[nodiscard]] constexpr
auto&& operator()(Number&& n)
const
31 return std::forward<Number>(n);
40 template<
typename Number>
44 template<
typename Number>
45 requires(std::is_integral_v<Number> || std::is_floating_point_v<Number> || _impl::is_constant<Number>::value)
struct to_rep<Number>
46 : _impl::default_to_rep<Number> {
51 template<
class Number>
52 [[nodiscard]] constexpr
auto to_rep(Number&& n)
53 -> decltype(
cnl::to_rep<remove_cvref_t<Number>>()(std::forward<Number>(n)))
60 #endif // CNL_IMPL_NUM_TRAITS_TO_REP_H