- string[meta header]
- std[meta namespace]
- function template[meta id-type]
namespace std {
template<class CharT, class Traits, class Allocator>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os,
const basic_string<CharT, Traits, Allocator>& s);
}
文字列をストリームへ出力する。
sentry
オブジェクトを構築する。sentry
オブジェクトが失敗を示した場合、何もしない。- 仮引数
s
が指し示す文字列を出力する。width()
とflags() & (ios_base::adjustfield)
に従ってパディングの出力も行う。
width(0)
を呼び出す。
os
#include <iostream>
#include <string>
int main() {
std::string s = "Tuna";
std::cout << s << std::endl;
}
Tuna
TBD
- C++98
- このほかの
<<
演算子関数