Make value the second argument to format_value

This commit is contained in:
Victor Zverovich
2016-10-25 06:19:19 -07:00
parent edf98792a5
commit b656a1c133
6 changed files with 25 additions and 23 deletions
+4 -4
View File
@@ -1355,8 +1355,8 @@ TEST(FormatterTest, FormatCStringRef) {
EXPECT_EQ("test", format("{0}", CStringRef("test")));
}
void format_value(fmt::Writer &w, fmt::basic_formatter<char> &f,
const char *, const Date &d) {
void format_value(fmt::Writer &w, const Date &d, fmt::basic_formatter<char> &f,
const char *) {
f.writer() << d.year() << '-' << d.month() << '-' << d.day();
}
@@ -1369,8 +1369,8 @@ TEST(FormatterTest, FormatCustom) {
class Answer {};
template <typename Char>
void format_value(BasicWriter<Char> &w, fmt::basic_formatter<Char> &f,
const Char *, Answer) {
void format_value(BasicWriter<Char> &w, Answer, fmt::basic_formatter<Char> &f,
const Char *) {
f.writer() << "42";
}
+4 -4
View File
@@ -64,8 +64,8 @@ namespace {
struct Test {};
template <typename Char>
void format_value(fmt::BasicWriter<Char> &w, fmt::basic_formatter<Char> &f,
const Char *, Test) {
void format_value(fmt::BasicWriter<Char> &w, Test,
fmt::basic_formatter<Char> &f, const Char *) {
w << "test";
}
@@ -582,8 +582,8 @@ struct CustomFormatter {
typedef char char_type;
};
void format_value(fmt::Writer &, CustomFormatter &, const char *&s,
const Test &) {
void format_value(fmt::Writer &, const Test &, CustomFormatter &,
const char *&s) {
s = "custom_format";
}