You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <cassert>
#include <fmt/format.h>
enum class MyEnum : char {
one = '1',
two = '2',
three = '3'
};
char format_as(MyEnum e) {
return static_cast<char>(e);
}
int main() {
assert(fmt::format("{}", MyEnum::one) == "1"); // compiles and works as expected
assert(fmt::to_string(MyEnum::one) == "1"); // does not compile
return 0;
}
The text was updated successfully, but these errors were encountered:
I thought that fmt::to_string() would use custom format_as() overloads, but it seems not to. Is this expected?
Using gcc13, c++20
https://godbolt.org/z/3fo53PoYW
The text was updated successfully, but these errors were encountered: