Get rid of ArgVisitor

This commit is contained in:
Victor Zverovich
2016-11-20 09:11:13 -08:00
parent d58cc8a4a8
commit d4084ac5b1
4 changed files with 36 additions and 257 deletions
+4 -2
View File
@@ -21,10 +21,12 @@ class CustomArgFormatter
fmt::FormatSpec &s)
: fmt::BasicArgFormatter<CustomArgFormatter, char>(w, ctx, s) {}
void visit_double(double value) {
using fmt::BasicArgFormatter<CustomArgFormatter, char>::operator();
void operator()(double value) {
if (round(value * pow(10, spec().precision())) == 0)
value = 0;
fmt::BasicArgFormatter<CustomArgFormatter, char>::visit_double(value);
fmt::BasicArgFormatter<CustomArgFormatter, char>::operator()(value);
}
};