std:: showpoint, std:: noshowpoint
|
定義済みヘッダー
<ios>
|
||
|
std::
ios_base
&
showpoint
(
std::
ios_base
&
str
)
;
|
(1) | |
|
std::
ios_base
&
noshowpoint
(
std::
ios_base
&
str
)
;
|
(2) | |
浮動小数点出力における小数点文字の無条件の包含を有効または無効にします。入力には影響しません。
showpoint
フラグを有効化します。
str.
setf
(
std::
ios_base
::
showpoint
)
を呼び出した場合と同様の効果があります。
showpoint
フラグを無効にします。これは
str.
unsetf
(
std::
ios_base
::
showpoint
)
を呼び出した場合と同様の効果があります。
これはI/Oマニピュレータであり、
out
<<
std
::
showpoint
のような式で呼び出すことができます(
out
が
std::basic_ostream
型の場合)。または、
in
>>
std
::
showpoint
のような式で呼び出すこともできます(
in
が
std::basic_istream
型の場合)。
小数点として使用する文字は、出力時にストリームにimbueされたロケールのnumpunctファセットによって決定されます。詳細は std::num_put::put で説明されています。
目次 |
パラメータ
| str | - | I/Oストリームへの参照 |
戻り値
str (操作後のストリームへの参照)。
例
#include <iostream> int main() { std::cout << "1.0 with showpoint: " << std::showpoint << 1.0 << '\n' << "1.0 with noshowpoint: " << std::noshowpoint << 1.0 << '\n'; }
出力:
1.0 with showpoint: 1.00000 1.0 with noshowpoint: 1
関連項目
|
指定された ios_base フラグをクリア
(関数) |
|
指定された
ios_base
フラグを設定
(関数) |