| 84 | }; |
| 85 | |
| 86 | struct printf_precision_handler { |
| 87 | template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)> |
| 88 | auto operator()(T value) -> int { |
| 89 | if (!int_checker<std::numeric_limits<T>::is_signed>::fits_in_int(value)) |
| 90 | report_error("number is too big"); |
| 91 | return max_of(static_cast<int>(value), 0); |
| 92 | } |
| 93 | |
| 94 | template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)> |
| 95 | auto operator()(T) -> int { |
| 96 | report_error("precision is not integer"); |
| 97 | return 0; |
| 98 | } |
| 99 | }; |
| 100 | |
| 101 | // An argument visitor that returns true iff arg is a zero integer. |
| 102 | struct is_zero_int { |