mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 02:28:15 +00:00
Parameterize ostream functions on the type of the format string.
Signed-off-by: Daniela Engert <dani@ngrt.de>
This commit is contained in:
parent
f16a118e88
commit
fea712abb1
@ -141,16 +141,12 @@ inline void vprint(std::basic_ostream<Char> &os,
|
||||
fmt::print(cerr, "Don't {}!", "panic");
|
||||
\endrst
|
||||
*/
|
||||
template <typename... Args>
|
||||
inline void print(std::ostream &os, string_view format_str,
|
||||
template <typename S, typename... Args>
|
||||
inline typename std::enable_if<internal::is_format_string<S>::value>::type
|
||||
print(std::basic_ostream<FMT_CHAR(S)> &os, const S &format_str,
|
||||
const Args & ... args) {
|
||||
vprint<char>(os, format_str, make_format_args<format_context>(args...));
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
inline void print(std::wostream &os, wstring_view format_str,
|
||||
const Args & ... args) {
|
||||
vprint<wchar_t>(os, format_str, make_format_args<wformat_context>(args...));
|
||||
internal::checked_args<S, Args...> ca(format_str, args...);
|
||||
vprint(os, internal::to_string_view(format_str), *ca);
|
||||
}
|
||||
FMT_END_NAMESPACE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user