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

Class printf_precision_handler

source/extern/fmt/printf.h:81–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

vprintfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected