Commit 431d0f85 authored by Charles Milette's avatar Charles Milette Committed by Victor Zverovich

Use basic_string_view in non-template UDL

parent ad71f5a7
...@@ -3466,7 +3466,7 @@ template <typename Char, Char... CHARS> class udl_formatter { ...@@ -3466,7 +3466,7 @@ template <typename Char, Char... CHARS> class udl_formatter {
}; };
# else # else
template <typename Char> struct udl_formatter { template <typename Char> struct udl_formatter {
const Char* str; basic_string_view<Char> str;
template <typename... Args> template <typename... Args>
auto operator()(Args&&... args) const auto operator()(Args&&... args) const
...@@ -3477,7 +3477,7 @@ template <typename Char> struct udl_formatter { ...@@ -3477,7 +3477,7 @@ template <typename Char> struct udl_formatter {
# endif // FMT_USE_UDL_TEMPLATE # endif // FMT_USE_UDL_TEMPLATE
template <typename Char> struct udl_arg { template <typename Char> struct udl_arg {
const Char* str; basic_string_view<Char> str;
template <typename T> named_arg<T, Char> operator=(T&& value) const { template <typename T> named_arg<T, Char> operator=(T&& value) const {
return {str, std::forward<T>(value)}; return {str, std::forward<T>(value)};
...@@ -3508,13 +3508,13 @@ FMT_CONSTEXPR internal::udl_formatter<Char, CHARS...> operator""_format() { ...@@ -3508,13 +3508,13 @@ FMT_CONSTEXPR internal::udl_formatter<Char, CHARS...> operator""_format() {
std::string message = "The answer is {}"_format(42); std::string message = "The answer is {}"_format(42);
\endrst \endrst
*/ */
inline internal::udl_formatter<char> operator"" _format(const char* s, FMT_CONSTEXPR internal::udl_formatter<char> operator"" _format(const char* s,
std::size_t) { std::size_t n) {
return {s}; return {{s, n}};
} }
inline internal::udl_formatter<wchar_t> operator"" _format(const wchar_t* s, FMT_CONSTEXPR internal::udl_formatter<wchar_t> operator"" _format(
std::size_t) { const wchar_t* s, std::size_t n) {
return {s}; return {{s, n}};
} }
# endif // FMT_USE_UDL_TEMPLATE # endif // FMT_USE_UDL_TEMPLATE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment