Skip to content

Commit

Permalink
Fix build error on GCC-9
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Sep 10, 2022
1 parent 4e38606 commit da96383
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ auto write(OutputIt out, const std::tm& time, const std::locale& loc,
char format, char modifier = 0) -> OutputIt {
auto&& buf = get_buffer<Char>(out);
do_write<Char>(buf, time, loc, format, modifier);
return buf.out();
return get_iterator(buf);
}

template <typename Char, typename OutputIt,
Expand Down Expand Up @@ -1397,7 +1397,7 @@ inline bool isfinite(T) {
template <typename T, typename Int, FMT_ENABLE_IF(std::is_integral<T>::value)>
inline Int to_nonnegative_int(T value, Int upper) {
FMT_ASSERT(std::is_unsigned<Int>::value ||
(value >= 0 && to_unsigned(value) <= to_unsigned(upper)),
(value >= 0 && to_unsigned(value) <= to_unsigned(upper)),
"invalid value");
(void)upper;
return static_cast<Int>(value);
Expand Down
5 changes: 3 additions & 2 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2089,8 +2089,9 @@ FMT_CONSTEXPR auto make_write_int_arg(T value, sign_t sign)
return {abs_value, prefix};
}

template <typename Char = char> struct loc_writer {
buffer_appender<Char> out;
template <typename Char = char, typename OutputIt = buffer_appender<Char>>
struct loc_writer {
OutputIt out;
const basic_format_specs<Char>& specs;
std::basic_string<Char> sep;
std::string grouping;
Expand Down
2 changes: 1 addition & 1 deletion include/fmt/xchar.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ auto write_loc(OutputIt out, basic_format_arg<buffer_context<wchar_t>> val,
auto grouping = numpunct.grouping();
if (!grouping.empty()) separator = std::wstring(1, numpunct.thousands_sep());
return visit_format_arg(
loc_writer<wchar_t>{out, specs, separator, grouping, {}}, val);
loc_writer<wchar_t, OutputIt>{out, specs, separator, grouping, {}}, val);
#endif
return false;
}
Expand Down

0 comments on commit da96383

Please sign in to comment.