Added missing std::declval for non-default-constructible types (#4024)

This commit is contained in:
Matthias Moulin 2024-06-18 20:27:40 +02:00 committed by GitHub
parent c00149f5e2
commit ac96773230
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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_;