最終更新日時:
が更新

履歴 編集

class template
<locale>

std::num_put

namespace std {
  template <class charT, class OutputIterator = ostreambuf_iterator<charT> >
  class num_put : public locale::facet;
}

概要

(ここに、クラスの概要を記載する)

publicメンバ関数

名前 説明
(constructor) コンストラクタ
put 数値を出力する

静的メンバ変数

名前 説明
static locale::id id;

protectedメンバ関数

名前 説明
(destructor) デストラクタ
do_put 数値を出力する

浮動小数点数の書式変換

do_putが浮動小数点数を出力するとき、ios_basefloatfielduppercaseの状態に応じて、以下のprintf変換指定子に相当する書式が使われる。

状態 相当するprintf変換
floatfield == ios_base::fixed && !uppercase %f
floatfield == ios_base::fixed %F
floatfield == ios_base::scientific && !uppercase %e
floatfield == ios_base::scientific %E
floatfield == (ios_base::fixed \| ios_base::scientific) && !uppercase %a
floatfield == (ios_base::fixed \| ios_base::scientific) %A
!uppercase(上記以外) %g
(それ以外) %G

メンバ型

名前 説明
char_type 文字型 charT
iter_type 出力のイテレータ型 OutputIterator


出力

参照

  • LWG Issue 4084. std::fixed ignores std::uppercase
    • C++26で、floatfield == ios_base::fixedのときにuppercaseが設定されていれば%F(大文字)が使われることが明確化された(従来はfixedが常に%fuppercaseが無視されていた)