Commit 4c650057 authored by Victor Zverovich's avatar Victor Zverovich

FMT_CHAR -> char_t

parent 2833c76f
...@@ -1352,9 +1352,10 @@ template <typename... Args, typename S, ...@@ -1352,9 +1352,10 @@ template <typename... Args, typename S,
FMT_ENABLE_IF(is_compile_string<S>::value)> FMT_ENABLE_IF(is_compile_string<S>::value)>
void check_format_string(S); void check_format_string(S);
template <typename S, typename... Args, template <
FMT_ENABLE_IF(internal::is_string<S>::value)> typename S, typename... Args,
inline format_arg_store<typename buffer_context<FMT_CHAR(S)>::type, Args...> typename Char = enable_if_t<internal::is_string<S>::value, fmt::char_t<S>>>
inline format_arg_store<typename buffer_context<Char>::type, Args...>
make_args_checked(const S& format_str, const Args&... args) { make_args_checked(const S& format_str, const Args&... args) {
internal::check_format_string<Args...>(format_str); internal::check_format_string<Args...>(format_str);
return {args...}; return {args...};
...@@ -1386,8 +1387,8 @@ typename buffer_context<Char>::type::iterator vformat_to( ...@@ -1386,8 +1387,8 @@ typename buffer_context<Char>::type::iterator vformat_to(
fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23)); fmt::print("Elapsed time: {s:.2f} seconds", fmt::arg("s", 1.23));
\endrst \endrst
*/ */
template <typename S, typename T> template <typename S, typename T, typename Char = char_t<S>>
inline internal::named_arg<T, FMT_CHAR(S)> arg(const S& name, const T& arg) { inline internal::named_arg<T, Char> arg(const S& name, const T& arg) {
static_assert(internal::is_string<S>::value, ""); static_assert(internal::is_string<S>::value, "");
return {name, arg}; return {name, arg};
} }
...@@ -1405,11 +1406,12 @@ template <typename Char> ...@@ -1405,11 +1406,12 @@ template <typename Char>
struct is_contiguous<internal::buffer<Char>> : std::true_type {}; struct is_contiguous<internal::buffer<Char>> : std::true_type {};
/** Formats a string and writes the output to ``out``. */ /** Formats a string and writes the output to ``out``. */
template <typename Container, typename S> template <
typename std::enable_if<is_contiguous<Container>::value, typename Container, typename S,
std::back_insert_iterator<Container>>::type typename Char = enable_if_t<is_contiguous<Container>::value, char_t<S>>>
vformat_to(std::back_insert_iterator<Container> out, const S& format_str, std::back_insert_iterator<Container> vformat_to(
basic_format_args<typename buffer_context<FMT_CHAR(S)>::type> args) { std::back_insert_iterator<Container> out, const S& format_str,
basic_format_args<typename buffer_context<Char>::type> args) {
internal::container_buffer<Container> buf(internal::get_container(out)); internal::container_buffer<Container> buf(internal::get_container(out));
internal::vformat_to(buf, to_string_view(format_str), args); internal::vformat_to(buf, to_string_view(format_str), args);
return out; return out;
...@@ -1425,8 +1427,8 @@ inline std::back_insert_iterator<Container> format_to( ...@@ -1425,8 +1427,8 @@ inline std::back_insert_iterator<Container> format_to(
{internal::make_args_checked(format_str, args...)}); {internal::make_args_checked(format_str, args...)});
} }
template <typename S, typename Char = FMT_CHAR(S), template <typename S,
FMT_ENABLE_IF(internal::is_string<S>::value)> typename Char = enable_if_t<internal::is_string<S>::value, char_t<S>>>
inline std::basic_string<Char> vformat( inline std::basic_string<Char> vformat(
const S& format_str, const S& format_str,
basic_format_args<typename buffer_context<Char>::type> args) { basic_format_args<typename buffer_context<Char>::type> args) {
...@@ -1447,7 +1449,8 @@ inline std::basic_string<Char> vformat( ...@@ -1447,7 +1449,8 @@ inline std::basic_string<Char> vformat(
// std::basic_string<fmt::char_t<S>> to reduce the symbol size. // std::basic_string<fmt::char_t<S>> to reduce the symbol size.
template <typename S, typename... Args, template <typename S, typename... Args,
typename Char = enable_if_t<internal::is_string<S>::value, char_t<S>>> typename Char = enable_if_t<internal::is_string<S>::value, char_t<S>>>
inline std::basic_string<Char> format(const S& format_str, const Args&... args) { inline std::basic_string<Char> format(const S& format_str,
const Args&... args) {
return internal::vformat(to_string_view(format_str), return internal::vformat(to_string_view(format_str),
{internal::make_args_checked(format_str, args...)}); {internal::make_args_checked(format_str, args...)});
} }
......
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