# istream.tcc File Reference

## Detailed Description

This is an internal header file, included by other library headers. You should not attempt to use it directly.

Definition in file istream.tcc.

Go to the source code of this file.

## Namespaces

- namespace std

## Defines

- #define _ISTREAM_TCC

## Functions

- template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT, _Traits > &__in, _CharT *__s)
- template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & operator>> (basic_istream< _CharT, _Traits > &__in, _CharT &__c)
- template<typename _CharT, typename _Traits> basic_istream< _CharT, _Traits > & ws (basic_istream< _CharT, _Traits > &__in)

## Function Documentation

basic_istream< _CharT, _Traits > & operator>> | ( | basic_istream< _CharT, _Traits > & | __in,
|  | _CharT * | __s
| ) |

Character string extractors.

Parameters:

  | in | An input stream.
  | s | A pointer to a character array.

Returns:
  in

Behaves like one of the formatted arithmetic extractors described in std::basic_istream. After constructing a sentry object with good status, this function extracts up to `n` characters and stores them into the array starting at s. `n` is defined as:

- if `width()` is greater than zero, `n` is width()
- otherwise `n` is "the number of elements of the largest array of `char_type` that can store a terminating `eos`." [27.6.1.2.3]/6

Characters are extracted and stored until one of the following happens:

- `n-1` characters are stored
- EOF is reached
- the next character is whitespace according to the current locale
- the next character is a null byte (i.e., `charT()` )

`width(0)` is then called for the input stream.

If no characters are extracted, sets failbit.

Definition at line 1050 of file istream.tcc.

References ios_base::badbit, ios_base::eofbit, ios_base::failbit, ios_base::goodbit, and std::max().

basic_istream< _CharT, _Traits > & operator>> | ( | basic_istream< _CharT, _Traits > & | __in,
|  | _CharT & | __c
| ) |

Character extractors.

Parameters:

  | in | An input stream.
  | c | A character reference.

Returns:
  in

Behaves like one of the formatted arithmetic extractors described in std::basic_istream. After constructing a sentry object with good status, this function extracts a character (if one is available) and stores it in c. Otherwise, sets failbit in the input stream.

Definition at line 1023 of file istream.tcc.

References basic_ios::_M_setstate(), ios_base::badbit, ios_base::eofbit, ios_base::failbit, ios_base::goodbit, basic_ios::rdbuf(), and basic_ios::setstate().

basic_istream< _CharT, _Traits > & ws | ( | basic_istream< _CharT, _Traits > & | __is | ) |

Quick and easy way to eat whitespace.

This manipulator extracts whitespace characters, stopping when the next character is non-whitespace, or when the input sequence is empty. If the sequence is empty, `eofbit` is set in the stream, but not `failbit`.

The current locale is used to distinguish whitespace characters.

Example:

         MyClass   mc;

         std::cin >> std::ws >> mc;

will skip leading whitespace before calling operator>> on cin and your object. Note that the same effect can be achieved by creating a std::basic_istream::sentry inside your definition of operator>>.

Definition at line 1106 of file istream.tcc.

References ios_base::eofbit.