Adapt any string-like type to be used by {fmt} just like the standard string types already supported. The adaption is totally non-intrusive.
Signed-off-by: Daniela Engert <dani@ngrt.de>
diff --git a/include/fmt/printf.h b/include/fmt/printf.h
index d58fe9f..e12a4f6 100644
--- a/include/fmt/printf.h
+++ b/include/fmt/printf.h
@@ -606,7 +606,7 @@
typedef internal::basic_buffer<FMT_CHAR(S)> buffer;
typedef typename printf_context<buffer>::type context;
format_arg_store<context, Args...> as{ args... };
- return vsprintf(internal::to_string_view(format_str),
+ return vsprintf(to_string_view(format_str),
basic_format_args<context>(as));
}
@@ -637,7 +637,7 @@
typedef internal::basic_buffer<FMT_CHAR(S)> buffer;
typedef typename printf_context<buffer>::type context;
format_arg_store<context, Args...> as{ args... };
- return vfprintf(f, internal::to_string_view(format_str),
+ return vfprintf(f, to_string_view(format_str),
basic_format_args<context>(as));
}
@@ -664,7 +664,7 @@
typedef internal::basic_buffer<FMT_CHAR(S)> buffer;
typedef typename printf_context<buffer>::type context;
format_arg_store<context, Args...> as{ args... };
- return vprintf(internal::to_string_view(format_str),
+ return vprintf(to_string_view(format_str),
basic_format_args<context>(as));
}
@@ -696,7 +696,7 @@
typedef internal::basic_buffer<FMT_CHAR(S)> buffer;
typedef typename printf_context<buffer>::type context;
format_arg_store<context, Args...> as{ args... };
- return vfprintf(os, internal::to_string_view(format_str),
+ return vfprintf(os, to_string_view(format_str),
basic_format_args<context>(as));
}
FMT_END_NAMESPACE