1#ifndef VEG_META_INT_FIX_HPP_7S9Y48TFS
2#define VEG_META_INT_FIX_HPP_7S9Y48TFS
17template<
typename L,
typename R>
123#define VEG_OP(Op, Name, TypeName) \
124 VEG_TEMPLATE((typename R), \
125 requires(VEG_CONCEPT(index<R>)), \
126 VEG_NODISCARD VEG_INLINE constexpr auto \
129 const VEG_NOEXCEPT->typename _detail::binary_traits<Fix, R>::TypeName \
131 return _detail::binary_traits<Fix, R>::Name##_fn(*this, b); \
165#define VEG_CMP(Name, TypeName, Op) \
166 VEG_TEMPLATE((typename R), \
167 requires(VEG_CONCEPT(index<R>)), \
168 VEG_NODISCARD VEG_INLINE constexpr auto \
171 const VEG_NOEXCEPT->typename _detail::binary_traits<Fix, R>::TypeName \
173 return _detail::binary_traits<Fix, R>::cmp_##Name##_fn(*this, b); \
202 return (c ==
'0') ? 0 : (c ==
'1' ? 1 :
e());
207 return (c >=
'0' && c <=
'7') ?
u64(c -
'0') :
e();
212 return (c >=
'0' && c <=
'9') ?
u64(c -
'0') :
e();
217 return (c >=
'0' && c <=
'9')
219 : (c >=
'a' && c <=
'f')
221 : (c >=
'A' && c <=
'F')
240 return (len == 0) ? 0
253 : (
str[1] ==
'b' ||
str[1] ==
'B')
255 : (
str[1] ==
'x' ||
str[1] ==
'X')
261template<
char...
Chars>
267template<isize N, isize M>
271#define VEG_OP(Name, TypeName, Op) \
273 Fix<isize(usize(isize{ N }) Op usize(isize{ M }))>; \
274 VEG_NODISCARD VEG_INLINE static constexpr auto Name##_fn(Fix<N>, Fix<M>) \
275 VEG_NOEXCEPT->TypeName \
279 static_assert(true, "")
281#define VEG_CMP(Name, TypeName, Op) \
283 Boolean<(N Op M) ? yes : no>; \
284 VEG_NODISCARD VEG_INLINE static constexpr auto Name##_fn(Fix<N>, Fix<M>) \
285 VEG_NOEXCEPT->TypeName \
289 static_assert(true, "")
326inline namespace literals {
327template<
char... Chars>
#define VEG_OP(Op, Name, TypeName)
#define VEG_TEMPLATE(TParams, Constraint, Attr_Name,...)
#define VEG_DEF_CONCEPT(Tpl, Name,...)
constexpr auto parse_digit_10(char c, Error e) VEG_NOEXCEPT -> u64
constexpr auto parse_digit_16(char c, Error e) VEG_NOEXCEPT -> u64
constexpr auto parse_int(char const *str, u64 len, Error e) VEG_NOEXCEPT -> u64
constexpr auto parse_digit_2(char c, Error e) VEG_NOEXCEPT -> u64
constexpr auto parse_num(char const *str, u64 len, u64 radix, Error e) VEG_NOEXCEPT -> u64
constexpr auto parse_digit(u64 radix) VEG_NOEXCEPT -> parser
constexpr auto parse_digit_8(char c, Error e) VEG_NOEXCEPT -> u64
_detail::_meta::make_signed< usize >::Type isize
constexpr Boolean() VEG_NOEXCEPT=default
VEG_NODISCARD VEG_INLINE constexpr auto operator+() const VEG_NOEXCEPT -> Fix
VEG_TEMPLATE((typename R), requires(VEG_CONCEPT(index< R >) &&VEG_CONCEPT(index< typename _detail::binary_traits< Fix, R >::Div >)), VEG_NODISCARD VEG_INLINE constexpr auto operator/,(b, R)) const VEG_NOEXCEPT -> typename _detail::binary_traits< Fix, R >::Div
VEG_NODISCARD VEG_INLINE constexpr auto operator-() const VEG_NOEXCEPT -> Fix<-N >
VEG_TEMPLATE((typename R), requires(VEG_CONCEPT(index< R >) &&VEG_CONCEPT(index< typename _detail::binary_traits< Fix, R >::Mod >)), VEG_NODISCARD VEG_INLINE constexpr auto operator%,(b, R)) const VEG_NOEXCEPT -> typename _detail::binary_traits< Fix, R >::Mod
constexpr Fix() VEG_NOEXCEPT=default
constexpr auto operator()(u64 const *fail=nullptr) const VEG_NOEXCEPT -> u64
VEG_CMP(cmp_ge, CmpGE, >=)
VEG_CMP(cmp_neq, CmpNEq, !=)
VEG_NODISCARD static VEG_INLINE constexpr auto mod_fn(Fix< N >, Fix< M >) VEG_NOEXCEPT -> Mod
meta::if_t< M==0, void, Fix< N %(M !=0 ? M :1)> > Mod
meta::if_t< M==0, void, Fix< N/(M !=0 ? M :1)> > Div
VEG_NODISCARD static VEG_INLINE constexpr auto div_fn(Fix< N >, Fix< M >) VEG_NOEXCEPT -> Div
VEG_CMP(cmp_eq, CmpEq,==)
VEG_CMP(cmp_le, CmpLE,<=)
VEG_CMP(cmp_gt, CmpGT, >)
static constexpr char value[]