| 49 | namespace integral { |
| 50 | |
| 51 | template <typename Int> static constexpr auto read_int() noexcept { |
| 52 | using _impl_::tmp; |
| 53 | constexpr auto is_neg = tmp[0]; |
| 54 | constexpr auto succ = tmp[1]; |
| 55 | return block_(skip_whitespace(), is_neg = peek_() == '-', succ = false, |
| 56 | tmp = static_cast<Int>(0), |
| 57 | loop_(if_(peek_(*is_neg) != none_ && peek_(*is_neg) <= '9' && |
| 58 | peek_(*is_neg) >= '0')( |
| 59 | tmp = tmp * 10 + cast_<Int>(peek_(*is_neg) - '0'), |
| 60 | advance_(), succ = true) |
| 61 | ->else_(break_)), |
| 62 | if_(succ)(if_(is_neg)(advance_(), tmp *= static_cast<Int>(-1)), |
| 63 | break_(*tmp))); |
| 64 | } |
| 65 | |
| 66 | template <typename Int> static constexpr auto write_int(auto var) noexcept { |
| 67 | using _impl_::tmp; |