MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / printf_precision_handler

Class printf_precision_handler

extlibs/fmt/include/fmt/printf.h:37–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35};
36
37class printf_precision_handler {
38 public:
39 template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
40 int operator()(T value) {
41 if (!int_checker<std::numeric_limits<T>::is_signed>::fits_in_int(value))
42 FMT_THROW(format_error("number is too big"));
43 return (std::max)(static_cast<int>(value), 0);
44 }
45
46 template <typename T, FMT_ENABLE_IF(!std::is_integral<T>::value)>
47 int operator()(T) {
48 FMT_THROW(format_error("precision is not integer"));
49 return 0;
50 }
51};
52
53// An argument visitor that returns true iff arg is a zero integer.
54class is_zero_int {

Callers 1

formatMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected