10 #if !defined(CNL_OVERFLOW_INT_H)
11 #define CNL_OVERFLOW_INT_H
16 #include "_impl/custom_operator/native_tag.h"
17 #include "_impl/custom_operator/tagged.h"
18 #include "_impl/num_traits/from_value.h"
19 #include "_impl/num_traits/from_value_recursive.h"
20 #include "_impl/num_traits/rep_of.h"
21 #include "_impl/ostream.h"
22 #include "_impl/wrapper.h"
24 #include <type_traits>
36 template<
typename Rep =
int, overflow_tag Tag = undefined_overflow_tag>
42 template<
int Digits,
int Radix,
typename Rep, overflow_tag Tag>
43 struct scale<Digits, Radix, _impl::wrapper<Rep, Tag>> {
45 using value_type = _impl::wrapper<Rep, Tag>;
48 [[nodiscard]] constexpr
auto operator()(value_type
const& s)
const -> decltype(_impl::from_rep<value_type>(_impl::scale<Digits, Radix>(_impl::to_rep(s))))
50 return _impl::default_scale<Digits, Radix, value_type>{}(s);
59 template<
typename NumberRep, overflow_tag NumberTag,
typename Rep>
60 requires(!_impl::is_wrapper<Rep>)
struct set_rep<_impl::wrapper<NumberRep, NumberTag>, Rep>
61 : std::type_identity<_impl::wrapper<Rep, NumberTag>> {
68 template<
typename NumberRep, overflow_tag NumberTag, tag Tag>
69 struct set_tag<_impl::wrapper<NumberRep, NumberTag>, Tag>
70 : std::type_identity<_impl::wrapper<NumberRep, Tag>> {
74 #endif // CNL_OVERFLOW_INT_H