File tree 1 file changed +16
-6
lines changed 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ namespace std {
26
26
## テンプレートパラメータ制約
27
27
- `Out`は`OutputIterator<const charT&>`であること
28
28
29
+ ## 備考
30
+
31
+ 出力イテレータの型はフォーマット関数に指定したイテレータである必要はない。内部でバッファリングを行う実装が可能である。
29
32
30
33
## メンバ関数
31
34
@@ -51,26 +54,33 @@ namespace std {
51
54
class basic_format_context {
52
55
basic_format_args<basic_format_context> args_;
53
56
Out out_;
57
+ std::optional<std::locale> locale;
54
58
55
59
public:
56
60
using iterator = Out;
57
61
using char_type = charT;
58
62
template<class T> using formatter_type = formatter<T, charT>;
59
63
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)
61
68
{
69
+ }
70
+
71
+ basic_format_arg<basic_format_context> arg(size_t id) const {
62
72
return args_.get(id);
63
73
}
64
74
65
- std::locale locale();
75
+ std::locale locale() {
76
+ return locale_.value_or(std::locale());
77
+ }
66
78
67
- iterator out();
68
- {
79
+ iterator out() {
69
80
return out_;
70
81
}
71
82
72
- void advance_to(iterator it)
73
- {
83
+ void advance_to(iterator it) {
74
84
out_ = it;
75
85
}
76
86
};
You can’t perform that action at this time.
0 commit comments