We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom type stringers defined with to_string_view fail to compile:
The source for this problem is in <core.h>:
template <typename S, typename = void> struct char_t_impl {}; template <typename S> struct char_t_impl<S, enable_if_t<is_string<S>::value>> { using result = decltype(to_string_view(std::declval<S>())); using type = typename result::char_type; };
In this code, result::char_type could be replaced with result::value_type, or better yet with result::traits_type::char_type.
result::char_type
result::value_type
result::traits_type::char_type
Here is a temporary workaround that I'm using:
namespace NS { struct MyStruct{ ... string_view sv() const {...} ... }; inline std::string_view to_string_view(const MyStruct& v) { return {v.sv()}; } }; // namespace NS // somewhere in the root namespace... template <> struct fmt::internal::char_t_impl<NS::MyType> { using result = decltype(to_string_view(std::declval<NS::MyType>())); using type = typename result::traits_type::char_type; };
The text was updated successfully, but these errors were encountered:
string_view::char_type -> value_type (#1539)
bdd7f73
b55ea58
Good catch, thanks! Fixed in b55ea58.
Sorry, something went wrong.
Merge pull request #80 from fmtlib/master
dc240cc
string_view::char_type -> value_type (fmtlib#1539)
No branches or pull requests
Custom type stringers defined with to_string_view fail to compile:
The source for this problem is in <core.h>:
In this code,
result::char_type
could be replaced withresult::value_type
, or better yet withresult::traits_type::char_type
.Here is a temporary workaround that I'm using:
The text was updated successfully, but these errors were encountered: