mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-20 09:35:05 +08:00
libstdc++: Add default template argument to basic_istream_view
The standard shows this default template argument in the <ranges> synopsis, but it was missing in libstdc++. libstdc++-v3/ChangeLog: * include/std/ranges (basic_istream_view): Add default template argument. * testsuite/std/ranges/istream_view.cc: Check it.
This commit is contained in:
parent
fedadb60b6
commit
1a129376bb
@ -679,7 +679,8 @@ namespace views
|
|||||||
= requires(basic_istream<_CharT, _Traits>& is, _Val& t) { is >> t; };
|
= requires(basic_istream<_CharT, _Traits>& is, _Val& t) { is >> t; };
|
||||||
} // namespace __detail
|
} // namespace __detail
|
||||||
|
|
||||||
template<movable _Val, typename _CharT, typename _Traits>
|
template<movable _Val, typename _CharT,
|
||||||
|
typename _Traits = char_traits<_CharT>>
|
||||||
requires default_initializable<_Val>
|
requires default_initializable<_Val>
|
||||||
&& __detail::__stream_extractable<_Val, _CharT, _Traits>
|
&& __detail::__stream_extractable<_Val, _CharT, _Traits>
|
||||||
class basic_istream_view
|
class basic_istream_view
|
||||||
|
@ -94,6 +94,15 @@ test05()
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
test06()
|
||||||
|
{
|
||||||
|
// Default template argument
|
||||||
|
using V = std::ranges::basic_istream_view<int, char>;
|
||||||
|
using W = std::ranges::basic_istream_view<int, char, std::char_traits<char>>;
|
||||||
|
static_assert( std::is_same_v<V, W> );
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@ -102,4 +111,5 @@ main()
|
|||||||
test03();
|
test03();
|
||||||
test04();
|
test04();
|
||||||
test05();
|
test05();
|
||||||
|
test06();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user