Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 1.47 KB

istream-functions.md

File metadata and controls

66 lines (44 loc) · 1.47 KB
description title ms.date f1_keywords ms.assetid
Learn more about: <istream> functions
<istream> functions
11/04/2016
istream/std::swap
istream/std::ws
0301ea0d-4ded-4841-83dd-4253b55b3188

<istream> functions

swap
ws

swap

Exchanges the elements of two stream objects.

template <class Elem, class Tr>
void swap(
    basic_istream<Elem, Tr>& left,
    basic_istream<Elem, Tr>& right);

template <class Elem, class Tr>
void swap(
    basic_iostream<Elem, Tr>& left,
    basic_iostream<Elem, Tr>& right);

Parameters

left
A stream.

right
A stream.

ws

Skips white space in the stream.

template class<Elem, Tr> basic_istream<Elem, Tr>& ws(basic_istream<Elem, Tr>& _Istr);

Parameters

_Istr
A stream.

Return Value

The stream.

Remarks

The manipulator extracts and discards any elements ch for which use_facet< ctype< Elem> >( getloc). is( ctype< Elem>:: space, ch) is true.

The function calls setstate( eofbit) if it encounters end of file while extracting elements. It returns _Istr.

Example

See operator>> for an example of using ws.

See also

<istream>