Skip to content

Commit

Permalink
Added missing std::declval for non-default-constructible types (#4024)
Browse files Browse the repository at this point in the history
  • Loading branch information
matt77hias committed Jun 18, 2024
1 parent c00149f commit ac96773
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,11 +619,12 @@ struct formatter<
range_format::debug_string>> {
private:
using range_type = detail::maybe_const_range<R>;
using string_type = conditional_t<
std::is_constructible<detail::std_string_view<Char>,
decltype(detail::range_begin(R())),
decltype(detail::range_end(R()))>::value,
detail::std_string_view<Char>, std::basic_string<Char>>;
using string_type =
conditional_t<std::is_constructible<
detail::std_string_view<Char>,
decltype(detail::range_begin(std::declval<R>())),
decltype(detail::range_end(std::declval<R>()))>::value,
detail::std_string_view<Char>, std::basic_string<Char>>;

formatter<string_type, Char> underlying_;

Expand Down

0 comments on commit ac96773

Please sign in to comment.