MCPcopy Create free account
hub / github.com/fmtlib/fmt / printf_precision_handler

Class printf_precision_handler

include/fmt/printf.h:86–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84};
85
86struct 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.
102struct is_zero_int {

Callers 1

vprintfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected