Skip to content

Commit

Permalink
Add missing Allocator template argument for basic_memory_buffer in fo…
Browse files Browse the repository at this point in the history
…rmat_to

Remove deduced default template arguments in format_to and vformat_to.
Moves SFINAE check to non-deduced template parameter in format_to.
  • Loading branch information
voxmea committed May 21, 2021
1 parent 00149c0 commit cedfe6e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2691,17 +2691,18 @@ FMT_INLINE auto make_args_checked(const S& fmt,
return {args...};
}

template <typename S, typename Char = char_t<S>,
template <typename S, typename Char,
FMT_ENABLE_IF(detail::is_string<S>::value)>
inline void vformat_to(
detail::buffer<Char>& buf, const S& format_str,
basic_format_args<FMT_BUFFER_CONTEXT(type_identity_t<Char>)> args) {
return detail::vformat_to(buf, to_string_view(format_str), args);
}

template <typename S, typename... Args, size_t SIZE = inline_buffer_size,
typename Char = enable_if_t<detail::is_string<S>::value, char_t<S>>>
inline auto format_to(basic_memory_buffer<Char, SIZE>& buf, const S& format_str,
template <typename S, typename... Args, typename Char, size_t SIZE,
typename Allocator, FMT_ENABLE_IF(detail::is_string<S>::value)>
inline auto format_to(basic_memory_buffer<Char, SIZE, Allocator>& buf,
const S& format_str,
Args&&... args) ->
typename buffer_context<Char>::iterator {
const auto& vargs = fmt::make_args_checked<Args...>(format_str, args...);
Expand Down

0 comments on commit cedfe6e

Please sign in to comment.