File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ namespace std {
2626## テンプレートパラメータ制約
2727- `Out`は`OutputIterator<const charT&>`であること
2828
29+ ## 備考
30+
31+ 出力イテレータの型はフォーマット関数に指定したイテレータである必要はない。内部でバッファリングを行う実装が可能である。
2932
3033## メンバ関数
3134
@@ -51,26 +54,33 @@ namespace std {
5154 class basic_format_context {
5255 basic_format_args<basic_format_context> args_;
5356 Out out_;
57+ std::optional<std::locale> locale;
5458
5559 public:
5660 using iterator = Out;
5761 using char_type = charT;
5862 template<class T> using formatter_type = formatter<T, charT>;
5963
60- basic_format_arg<basic_format_context> arg(size_t id) const
64+ basic_format_context(iterator out, std::basic_format_args<basic_format_context> args, std::optional<std::locale> locale = std::nullopt)
65+ :args_(args)
66+ ,out_(out)
67+ ,locale_(locale)
6168 {
69+ }
70+
71+ basic_format_arg<basic_format_context> arg(size_t id) const {
6272 return args_.get(id);
6373 }
6474
65- std::locale locale();
75+ std::locale locale() {
76+ return locale_.value_or(std::locale());
77+ }
6678
67- iterator out();
68- {
79+ iterator out() {
6980 return out_;
7081 }
7182
72- void advance_to(iterator it)
73- {
83+ void advance_to(iterator it) {
7484 out_ = it;
7585 }
7686 };
You can’t perform that action at this time.
0 commit comments