Standard library header <iostream>
From cppreference.net
이 헤더는 Input/output 라이브러리의 일부입니다.
<iostream>
를 포함하는 것은 마치 정적 저장 기간을 가진
std::ios_base::Init
타입의 객체를 정의하는 것처럼 동작합니다. 이 객체의 생성자는 표준 스트림 객체들을 초기화하며 (만약 이것이 생성된 첫 번째
std::ios_base::Init
객체인 경우), 소멸자는 해당 객체들(
cin
과
wcin
은 제외)을 플러시합니다 (만약 이것이 소멸되는 마지막
std::ios_base::Init
객체인 경우).
포함 파일 |
||
|
(C++11)
|
std::ios_base 클래스, std::basic_ios 클래스 템플릿 및 typedefs | |
|
(C++11)
|
std::basic_streambuf 클래스 템플릿 | |
|
(C++11)
|
std::basic_istream 클래스 템플릿 및 typedefs | |
|
(C++11)
|
std::basic_ostream , std::basic_iostream 클래스 템플릿 및 typedefs | |
객체 |
||
|
표준 C 입력 스트림
stdin
에서 읽음
(전역 객체) |
||
|
표준 C 출력 스트림
stdout
에 기록
(전역 객체) |
||
|
표준 C 오류 스트림
stderr
에 기록, 버퍼링되지 않음
(전역 객체) |
||
|
표준 C 오류 스트림
stderr
에 기록
(전역 객체) |
||
시놉시스
#include <ios> #include <streambuf> #include <istream> #include <ostream> namespace std { extern istream cin; extern ostream cout; extern ostream cerr; extern ostream clog; extern wistream wcin; extern wostream wcout; extern wostream wcerr; extern wostream wclog; }
결함 보고서
다음의 동작 변경 결함 보고서들은 이전에 발표된 C++ 표준에 소급 적용되었습니다.
| DR | 적용 대상 | 게시된 동작 | 올바른 동작 |
|---|---|---|---|
| LWG 155 | C++98 |
정적 객체의 타입이
std::basic_ios::Init
(엄밀히 틀리지는 않았으나, 표현이 오해의 소지가 있었음) |
std::ios_base::Init
로 수정됨
|
| LWG 1123 | C++98 |
<iostream>
포함이
std::ios_base::Init 객체의 생성을 보장하지 않음 |
보장함 |