Helper templates
template< class Val >
using istream_view = ranges::basic_istream_view<Val, char>;
template< class Val >
using wistream_view = ranges::basic_istream_view<Val, wchar_t>;
Customization point objects
namespace views { template< class T >
constexpr /* unspecified */ istream = /* unspecified */;
Helper concepts
template< class Val, class CharT, class Traits >concept /*stream-extractable*/ =
requires(std::basic_istream<CharT, Traits>& is, Val& t) {
is >> t;
1) A range factory that generates a sequence of elements by repeatedly calling operator>>.
2,3) Convenience alias templates for character types char and wchar_t.
The program is ill-formed if
U
is not both publicly and unambiguously derived from
std::basic_istream<typename U::char_type, typename U::traits_type>, which may result in a
substitution failure.
5)The exposition-only concept
/*stream-extractable*/<Val, CharT, Traits>is satisfied when lvalue of type
Val
can be extracted from lvalue of type
std::basic_istream<CharT, Traits>.
The iterator type of basic_istream_view
is move-only: it does not meet the LegacyIterator requirements, and thus does not work with pre-C++20 algorithms.
The name views::istream<T>
denotes a customization point object, which is a const function object of a literal semiregular
class type. See CustomizationPointObject for details.
stream_
a pointer to the input stream
Val
value_
the stored value
basic_istream_view
std::ranges::view_interface<D>
) [edit] returns a sentinel for the constant iterator of the range
std::ranges::view_interface<D>
) [edit] std::ranges::basic_istream_view::basic_istream_view (since C++20)
Initializes stream_
with std::addressof(stream), and value-initializes value_
.
constexpr auto begin();
(since C++20)Equivalent to *stream_
>>
value_
; return
iterator
{*this};.
basic_istream_view
Output:
/today/ /is/ /yesterdayâs/ /tomorrow/ 1.1, 2.2, 3.3, 4.4, 55, 66, 7.7, 8.8,[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 3568 C++20 P2325R3 accidentally made the stored value default-initialized restored to value-initialization P2325R3 C++20 default constructor was provided asview
must be default_initializable
removed along with
ranges::istream_view
was a function template
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4