Added support for strings containing '\0' in udl (#619)
This commit is contained in:
parent
84bd2f1962
commit
79c478cd0c
@ -4093,7 +4093,7 @@ class udl_formatter {
|
||||
# else
|
||||
template <typename Char>
|
||||
struct udl_formatter {
|
||||
const Char *str;
|
||||
basic_string_view<Char> str;
|
||||
|
||||
template <typename... Args>
|
||||
auto operator()(Args && ... args) const
|
||||
@ -4105,7 +4105,7 @@ struct udl_formatter {
|
||||
|
||||
template <typename Char>
|
||||
struct udl_arg {
|
||||
const Char *str;
|
||||
basic_string_view<Char> str;
|
||||
|
||||
template <typename T>
|
||||
named_arg<basic_context<Char>> operator=(T &&value) const {
|
||||
@ -4134,9 +4134,9 @@ constexpr internal::udl_formatter<Char, CHARS...> operator""_format() {
|
||||
\endrst
|
||||
*/
|
||||
inline internal::udl_formatter<char>
|
||||
operator"" _format(const char *s, std::size_t) { return {s}; }
|
||||
operator"" _format(const char *s, std::size_t n) { return {s, n}; }
|
||||
inline internal::udl_formatter<wchar_t>
|
||||
operator"" _format(const wchar_t *s, std::size_t) { return {s}; }
|
||||
operator"" _format(const wchar_t *s, std::size_t n) { return {s, n}; }
|
||||
# endif // FMT_UDL_TEMPLATE
|
||||
|
||||
/**
|
||||
@ -4150,9 +4150,9 @@ operator"" _format(const wchar_t *s, std::size_t) { return {s}; }
|
||||
\endrst
|
||||
*/
|
||||
inline internal::udl_arg<char>
|
||||
operator"" _a(const char *s, std::size_t) { return {s}; }
|
||||
operator"" _a(const char *s, std::size_t n) { return {s, n}; }
|
||||
inline internal::udl_arg<wchar_t>
|
||||
operator"" _a(const wchar_t *s, std::size_t) { return {s}; }
|
||||
operator"" _a(const wchar_t *s, std::size_t n) { return {s, n}; }
|
||||
} // inline namespace literals
|
||||
} // namespace fmt
|
||||
#endif // FMT_USE_USER_DEFINED_LITERALS
|
||||
|
||||
Loading…
Reference in New Issue
Block a user