Move contiguous version of format_to to fmt/core.h

This commit is contained in:
Victor Zverovich 2018-07-22 18:09:22 -07:00
parent 8db14efa84
commit c684349195
2 changed files with 17 additions and 17 deletions

View File

@ -1336,6 +1336,23 @@ typename std::enable_if<
return out;
}
template <typename Container, typename... Args>
inline typename std::enable_if<
is_contiguous<Container>::value, std::back_insert_iterator<Container>>::type
format_to(std::back_insert_iterator<Container> out,
string_view format_str, const Args & ... args) {
return vformat_to(out, format_str, make_format_args<format_context>(args...));
}
template <typename Container, typename... Args>
inline typename std::enable_if<
is_contiguous<Container>::value, std::back_insert_iterator<Container>>::type
format_to(std::back_insert_iterator<Container> out,
wstring_view format_str, const Args & ... args) {
return vformat_to(out, format_str,
make_format_args<wformat_context>(args...));
}
std::string vformat(string_view format_str, format_args args);
std::wstring vformat(wstring_view format_str, wformat_args args);

View File

@ -3579,23 +3579,6 @@ inline OutputIt format_to(OutputIt out, string_view format_str,
make_format_args<typename format_context_t<OutputIt>::type>(args...));
}
template <typename Container, typename... Args>
inline typename std::enable_if<
is_contiguous<Container>::value, std::back_insert_iterator<Container>>::type
format_to(std::back_insert_iterator<Container> out,
string_view format_str, const Args & ... args) {
return vformat_to(out, format_str, make_format_args<format_context>(args...));
}
template <typename Container, typename... Args>
inline typename std::enable_if<
is_contiguous<Container>::value, std::back_insert_iterator<Container>>::type
format_to(std::back_insert_iterator<Container> out,
wstring_view format_str, const Args & ... args) {
return vformat_to(out, format_str,
make_format_args<wformat_context>(args...));
}
template <typename OutputIt>
struct format_to_n_result {
/** Iterator past the end of the output range. */