Skip to content

Commit

Permalink
Merge pull request #1155 from cpprefjp/fix-formatter-formattable
Browse files Browse the repository at this point in the history
Fix range_formatter and formattable
  • Loading branch information
faithandbrave committed Jul 3, 2023
2 parents 02a3b21 + 313f64e commit c99be70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion reference/format/formattable.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```cpp
namespace std {
template <class charT>
concept fmt-iter-for = output_iterator<const charT&>;
using fmt-iter-for = /* unspecified */;

template <class T, class charT>
concept formattable =
Expand All @@ -23,6 +23,8 @@ namespace std {
};
}
```
* fmt-iter-for[italic]
* unspecified[italic]
* formatter[link formatter.md]
* semiregular[link /reference/concepts/semiregular.md]
* basic_format_context[link basic_format_context.md]
Expand All @@ -33,6 +35,7 @@ namespace std {
このコンセプトを使用することで、[`formatter`](formatter.md)クラステンプレートが使用したい型で特殊化されているかをチェックできる。
`formattable`コンセプトの定義において使用されている`fmt-iter-for<charT>`は、[`output_iterator<const charT&>`](/reference/iterator/output_iterator.md)コンセプトのモデルとなる未規定の型である。
## 例
```cpp example
Expand Down
2 changes: 1 addition & 1 deletion reference/format/range_formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public:
// format()関数は書式の情報をもたない。
// parse()関数で解析した書式をメンバ変数で保持しておいて、
// それをもとに書式化する
auto format(MyVector<T>&& v, std::format_context& fctx) const {
auto format(const MyVector<T>& v, std::format_context& fctx) const {
if (is_colon) {
auto out = fctx.out();
bool is_first = true;
Expand Down

0 comments on commit c99be70

Please sign in to comment.