mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 21:12:05 +00:00
Improve error reporting
This commit is contained in:
parent
598e6042d1
commit
a770009fcc
@ -930,6 +930,16 @@ template <typename Context> struct arg_mapper {
|
|||||||
std::memcpy(val.data, &arg, sizeof(arg));
|
std::memcpy(val.data, &arg, sizeof(arg));
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int map(...) {
|
||||||
|
constexpr bool formattable = sizeof(Context) == 0;
|
||||||
|
static_assert(
|
||||||
|
formattable,
|
||||||
|
"Cannot format argument. To make type T formattable provide a "
|
||||||
|
"formatter<T> specialization: "
|
||||||
|
"https://fmt.dev/latest/api.html#formatting-user-defined-types");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// A type constant after applying arg_mapper<Context>.
|
// A type constant after applying arg_mapper<Context>.
|
||||||
|
Loading…
Reference in New Issue
Block a user