7 #if !defined(CNL_IMPL_NUM_TRAITS_WRAP_H)
8 #define CNL_IMPL_NUM_TRAITS_WRAP_H
10 #include "is_composite.h"
15 template<
typename Number,
typename Rep>
18 template<
typename Number,
typename Rep>
19 requires(!is_composite_v<Number>)
struct wrap<Number, Rep> {
20 [[nodiscard]] constexpr
auto operator()(Rep
const& n)
const
26 template<
typename Number,
typename Rep>
27 requires(is_composite_v<Number>)
struct wrap<Number, Rep> {
28 [[nodiscard]] constexpr
auto operator()(Rep
const& rep)
const
30 return from_rep<Number>(wrap<rep_of_t<Number>, Rep>{}(rep));
35 template<
typename Number,
typename Rep>
36 [[nodiscard]] constexpr
auto wrap(Rep
const& rep)
38 return _impl::wrap<Number, Rep>{}(rep);
42 #endif // CNL_IMPL_NUM_TRAITS_WRAP_H