The Wayback Machine - https://web.archive.org/web/20191217120823/https://ja.cppreference.com/w/cpp/header/iterator
名前空間
変種
操作

標準ライブラリヘッダ <iterator>

提供: cppreference.com
< cpp‎ | header
 
 
 

このヘッダはイテレータライブラリの一部です。

目次

コンセプト

イテレータコンセプト
型が * 演算子を適用することによって読み込み可能であることを指定します
(コンセプト)[edit]
イテレータの参照先のオブジェクトに値を書き込めることを指定します
(コンセプト)[edit]
前置または後置インクリメント演算子で semiregular 型をインクリメントできることを指定します
(コンセプト)[edit]
weakly_incrementable 型に対するインクリメント演算が等しさを維持することおよびその型が equality_comparable であることを指定します
(コンセプト)[edit]
その型のオブジェクトがインクリメントおよび逆参照できることを指定します
(コンセプト)[edit]
型が input_or_output_iterator 型に対する番兵であることを指定します
(コンセプト)[edit]
差を定数時間で計算するためにイテレータと番兵に - 演算子を適用できることを指定します
(コンセプト)[edit]
型が入力イテレータである、つまり、参照先の値を読むことができ、前置および後置インクリメントができることを指定します
(コンセプト)[edit]
型が指定された値型のための出力イテレータである、つまり、その型の値を書き込むことができ、前置および後置インクリメントができることを指定します
(コンセプト)[edit]
input_iterator が前進イテレータであり、等価比較とマルチパスをサポートすることを指定します
(コンセプト)[edit]
forward_iterator が双方向イテレータであり、逆方向の移動をサポートすることを指定します
(コンセプト)[edit]
bidirectional_iterator がランダムアクセスイテレータであり、定数時間での前進および添字アクセスをサポートすることを指定します
(コンセプト)[edit]
random_access_iterator が隣接イテレータであり、メモリ内で隣接する要素を参照していることを指定します
(コンセプト)[edit]
間接呼び出し可能コンセプト
callable 型が readable 型を逆参照した結果を用いて呼ぶことができることを指定します
(コンセプト)[edit]
callable 型が readable 型を逆参照した結果を用いて呼ばれたときに predicate を満たすことを指定します
(コンセプト)[edit]
callable 型が2つの readable 型を逆参照した結果を用いて呼ばれたときに predicate を満たすことを指定します
(コンセプト)[edit]
callable 型が2つの readable を逆参照した結果を用いて呼ばれたときに strict_weak_order を満たすことを指定します
(コンセプト)[edit]
共通アルゴリズム要件
readable 型から writable 型に値をムーブできることを指定します
(コンセプト)[edit]
readable 型から writable 型に値をムーブできることとそのムーブが中間オブジェクト経由で行うことができることを指定します
(コンセプト)[edit]
readable 型から writable 型に値をコピーできることを指定します
(コンセプト)[edit]
readable 型から writable 型に値をコピーできることとそのコピーが中間オブジェクト経由で行うことができることを指定します
(コンセプト)[edit]
2つの readable 型の参照先の値がスワップ可能であることを指定します
(コンセプト)[edit]
2つの readable 型の参照先の値が比較できることを指定します
(コンセプト)[edit]
その場で要素を並べ替えるアルゴリズムの共通の要件を指定します
(コンセプト)[edit]
要素をコピーすることによってソート済みシーケンスを出力シーケンスにマージするアルゴリズムの要件を指定します
(コンセプト)[edit]
シーケンスを順序付きシーケンスに並び替えるアルゴリズムの共通の要件を指定します
(コンセプト)[edit]

クラス

アルゴリズムのユーティリティ
readable 型の何らかの集合を逆参照した結果に対して callable オブジェクトを呼び出した結果を計算します
(エイリアステンプレート)[edit]
射影を受け取るアルゴリズムに対する制約を指定するためのヘルパーテンプレート
(クラステンプレート)[edit]
関連型
weakly_incrementable 型の差型を計算します
(クラステンプレート)[edit]
readable 型の値型を計算します
(クラステンプレート)[edit]
イテレータの関連型を計算します
(エイリアステンプレート)[edit]
プリミティブ
イテレータの性質への統一されたインタフェースを提供します
(クラステンプレート)[edit]
イテレータのカテゴリを表すために使用される空のクラス型
(クラス)[edit]
(C++17で非推奨)
シンプルなイテレータのための型要件の定義を簡単にする基底クラス
(クラステンプレート)[edit]
アダプタ
逆順探索のためのイテレータアダプタ
(クラステンプレート)[edit]
右辺値参照を逆参照するイテレータアダプタ
(クラステンプレート)[edit]
std::move_iterator と共に使用するための番兵アダプタ
(クラステンプレート)[edit]
イテレータ型とその番兵を共通イテレータ型に適合させます
(クラステンプレート)[edit]
範囲の境界を知っているイテレータと共に使用するためのデフォルトの番兵
(クラス)[edit]
範囲の終端までの距離を追跡するイテレータアダプタ
(クラステンプレート)[edit]
いかなる weakly_incrementable 型とも常に等しくないと比較される番兵
(クラス)[edit]
コンテナの末尾に挿入するためのイテレータアダプタ
(クラステンプレート)[edit]
コンテナの先頭に挿入するためのイテレータアダプタ
(クラステンプレート)[edit]
コンテナに挿入するためのイテレータアダプタ
(クラステンプレート)[edit]
ストリームイテレータ
std::basic_istream から読み込む入力イテレータ
(クラステンプレート)[edit]
std::basic_ostream に書き込む出力イテレータ
(クラステンプレート)[edit]
std::basic_streambuf から読み込む入力イテレータ
(クラステンプレート)[edit]
std::basic_streambuf に書き込む出力イテレータ
(クラステンプレート)[edit]

カスタマイゼーションポイントオブジェクト

名前空間 std::ranges で定義
オブジェクトを逆参照した結果をその関連する右辺値参照型にキャストします
(カスタマイゼーションポイントオブジェクト)[edit]
2つの逆参照可能オブジェクトの参照先の値を入れ替えます
(カスタマイゼーションポイントオブジェクト)[edit]

関数

アダプタ
引数から推定した型の std::reverse_iterator を作成します
(関数テンプレート)[edit]
引数から推定した型の std::move_iterator を作成します
(関数テンプレート)[edit]
引数から推定した型の std::front_insert_iterator を作成します
(関数テンプレート)[edit]
引数から推定した型の std::back_insert_iterator を作成します
(関数テンプレート)[edit]
引数から推定した型の std::insert_iterator を作成します
(関数テンプレート)[edit]
非メンバ演算子
ベースとなるイテレータを比較します
(関数テンプレート)[edit]
イテレータを進めます
(関数テンプレート)[edit]
2つのイテレータアダプタ間の距離を計算します
(関数テンプレート)[edit]
ベースとなるイテレータを比較します
(関数テンプレート)[edit]
イテレータを進めます
(関数テンプレート)[edit]
2つのイテレータアダプタ間の距離を計算します
(関数テンプレート)[edit]
2つの istream_iterator を比較します
(関数テンプレート)[edit]
2つの istreambuf_iterator を比較します
(関数テンプレート)[edit]
操作
イテレータを指定された距離だけ前進させます
(関数)[edit]
2つのイテレータ間の距離を返します
(関数)[edit]
(C++11)
イテレータをインクリメントします
(関数)[edit]
(C++11)
イテレータをデクリメントします
(関数)[edit]
イテレータを指定された距離または指定された境界まで前進させます
(ニーブロイド)[edit]
イテレータと番兵の間または範囲の先頭と終端の間の距離を返します
(ニーブロイド)[edit]
イテレータを指定された距離または境界までインクリメントします
(ニーブロイド)[edit]
イテレータを指定された距離または境界までデクリメントします
(ニーブロイド)[edit]
範囲アクセス
(C++11)(C++14)
コンテナまたは配列の先頭を指すイテレータを返します
(関数)[edit]
(C++11)(C++14)
コンテナまたは配列の終端を指すイテレータを返します
(関数)[edit]
コンテナまたは配列の先頭を指す逆イテレータを返します
(関数)[edit]
(C++14)
コンテナまたは配列の終端を指す逆イテレータを返します
(関数)[edit]
(C++17)(C++20)
コンテナまたは配列のサイズを返します
(関数テンプレート)[edit]
(C++17)
コンテナが空かどうか調べます
(関数)[edit]
(C++17)
ベースとなる配列を指すポインタを取得します
(関数)[edit]

[編集]概要

#include <concepts>   namespace std {template<class T>using __with_reference = T&;// exposition onlytemplate<class T> concept __Referenceable // exposition only= requires {typename __with_reference<T>;};template<class T> concept __Dereferenceable // exposition only= requires(T& t){{*t }-> __Referenceable;// not required to be equality-preserving};   // associated types// incrementable traitstemplate<class>struct incrementable_traits;template<class T>using iter_difference_t =/* see description */;   // readable traitstemplate<class>struct readable_traits;template<class T>using iter_value_t =/* see description */;   // iterator traitstemplate<class I>struct iterator_traits;template<class T> requires is_object_v<T>struct iterator_traits<T*>;   template<__Dereferenceable T>using iter_reference_t = decltype(*declval<T&>());   namespace ranges {// customization pointsinlinenamespace/* unspecified */{// ranges​::​iter_moveinlineconstexpr/* unspecified */ iter_move =/* unspecified */;   // ranges​::​iter_swapinlineconstexpr/* unspecified */ iter_swap =/* unspecified */;}}   template<__Dereferenceable T> requires requires(T& t){{ ranges::iter_move(t)}-> __Referenceable;}using iter_rvalue_reference_t = decltype(ranges::iter_move(declval<T&>()));   // iterator concepts// concept readabletemplate<class In> concept readable =/* see description */;   template<readable T>using iter_common_reference_t = common_reference_t<iter_reference_t<T>, iter_value_t<T>&>;   // concept writabletemplate<class Out, class T> concept writable =/* see description */;   // concept weakly_incrementabletemplate<class I> concept weakly_incrementable =/* see description */;   // concept incrementabletemplate<class I> concept incrementable =/* see description */;   // concept input_or_output_iteratortemplate<class I> concept input_or_output_iterator =/* see description */;   // concept sentinel_fortemplate<class S, class I> concept sentinel_for =/* see description */;   // concept sized_sentinel_fortemplate<class S, class I>inlineconstexprbool disable_sized_sentinel =false;   template<class S, class I> concept sized_sentinel_for =/* see description */;   // concept input_iteratortemplate<class I> concept input_iterator =/* see description */;   // concept output_iteratortemplate<class I, class T> concept output_iterator =/* see description */;   // concept forward_iteratortemplate<class I> concept forward_iterator =/* see description */;   // concept bidirectional_iteratortemplate<class I> concept bidirectional_iterator =/* see description */;   // concept random_access_iteratortemplate<class I> concept random_access_iterator =/* see description */;   // concept contiguous_iteratortemplate<class I> concept contiguous_iterator =/* see description */;   // indirect callable requirements// indirect callablestemplate<class F, class I> concept indirectly_unary_invocable =/* see description */;   template<class F, class I> concept indirectly_regular_unary_invocable =/* see description */;   template<class F, class I> concept indirect_unary_predicate =/* see description */;   template<class F, class I1, class I2 = I1> concept indirect_relation =/* see description */;   template<class F, class I1, class I2 = I1> concept indirect_strict_weak_order =/* see description */;   template<class F, class... Is> requires (readable<Is>&& ...)&& invocable<F, iter_reference_t<Is>...>using indirect_result_t = invoke_result_t<F, iter_reference_t<Is>...>;   // projectedtemplate<readable I, indirectly_regular_unary_invocable<I> Proj>struct projected;   template<weakly_incrementable I, class Proj>struct incrementable_traits<projected<I, Proj>>;   // common algorithm requirements// concept indirectly_movabletemplate<class In, class Out> concept indirectly_movable =/* see description */;   template<class In, class Out> concept indirectly_movable_storable =/* see description */;   // concept indirectly_copyabletemplate<class In, class Out> concept indirectly_copyable =/* see description */;   template<class In, class Out> concept indirectly_copyable_storable =/* see description */;   // concept indirectly_swappabletemplate<class I1, class I2 = I1> concept indirectly_swappable =/* see description */;   // concept indirectly_comparabletemplate<class I1, class I2, class R, class P1 = identity, class P2 = identity> concept indirectly_comparable =/* see description */;   // concept permutabletemplate<class I> concept permutable =/* see description */;   // concept mergeabletemplate<class I1, class I2, class Out, class R = ranges::less, class P1 = identity, class P2 = identity> concept mergeable =/* see description */;   // concept sortabletemplate<class I, class R = ranges::less, class P = identity> concept sortable =/* see description */;   // primitives// iterator tagsstruct input_iterator_tag {};struct output_iterator_tag {};struct forward_iterator_tag:public input_iterator_tag {};struct bidirectional_iterator_tag:public forward_iterator_tag {};struct random_access_iterator_tag:public bidirectional_iterator_tag {};struct contiguous_iterator_tag:public random_access_iterator_tag {};   // iterator operationstemplate<class InputIter, class Distance>constexprvoid advance(InputIter& i, Distance n);template<class InputIter>constexprtypename iterator_traits<InputIter>::difference_type distance(InputIter first, InputIter last);template<class InputIter>constexpr InputIter next(InputIter x, typename iterator_traits<InputIter>::difference_type n =1);template<class BidirectionalIter>constexpr BidirectionalIter prev(BidirectionalIter x, typename iterator_traits<BidirectionalIter>::difference_type n =1);   // range iterator operationsnamespace ranges {// ranges​::​advancetemplate<input_or_output_iterator I>constexprvoid advance(I& i, iter_difference_t<I> n);template<input_or_output_iterator I, sentinel_for<I> S>constexprvoid advance(I& i, S bound);template<input_or_output_iterator I, sentinel_for<I> S>constexpr iter_difference_t<I> advance(I& i, iter_difference_t<I> n, S bound);   // ranges​::​distancetemplate<input_or_output_iterator I, sentinel_for<I> S>constexpr iter_difference_t<I> distance(I first, S last);template<range R>constexpr range_difference_t<R> distance(R&& r);   // ranges​::​nexttemplate<input_or_output_iterator I>constexpr I next(I x);template<input_or_output_iterator I>constexpr I next(I x, iter_difference_t<I> n);template<input_or_output_iterator I, sentinel_for<I> S>constexpr I next(I x, S bound);template<input_or_output_iterator I, sentinel_for<I> S>constexpr I next(I x, iter_difference_t<I> n, S bound);   // ranges​::​prevtemplate<bidirectional_iterator I>constexpr I prev(I x);template<bidirectional_iterator I>constexpr I prev(I x, iter_difference_t<I> n);template<bidirectional_iterator I>constexpr I prev(I x, iter_difference_t<I> n, I bound);}   // predefined iterators and sentinels// reverse iteratorstemplate<class Iter>class reverse_iterator;   template<class Iter1, class Iter2>constexprbool operator==(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator!=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator<(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator>(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator<=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator>=(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);template<class Iter1, three_way_comparable_with<Iter1> Iter2>constexpr compare_three_way_result_t<Iter1, Iter2> operator<=>(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y);   template<class Iter1, class Iter2>constexprauto operator-(const reverse_iterator<Iter1>& x, const reverse_iterator<Iter2>& y)-> decltype(y.base()- x.base());template<class Iter>constexpr reverse_iterator<Iter> operator+(typename reverse_iterator<Iter>::difference_type n, const reverse_iterator<Iter>& x);   template<class Iter>constexpr reverse_iterator<Iter> make_reverse_iterator(Iter i);   template<class Iter1, class Iter2> requires (!sized_sentinel_for<Iter1, Iter2>)inlineconstexprbool disable_sized_sentinel<reverse_iterator<Iter1>, reverse_iterator<Iter2>>=true;   // insert iteratorstemplate<class Container>class back_insert_iterator;template<class Container>constexpr back_insert_iterator<Container> back_inserter(Container& x);   template<class Container>class front_insert_iterator;template<class Container>constexpr front_insert_iterator<Container> front_inserter(Container& x);   template<class Container>class insert_iterator;template<class Container>constexpr insert_iterator<Container> inserter(Container& x, ranges::iterator_t<Container> i);   // move iterators and sentinelstemplate<class Iter>class move_iterator;   template<class Iter1, class Iter2>constexprbool operator==(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator<(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator>(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator<=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);template<class Iter1, class Iter2>constexprbool operator>=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);template<class Iter1, three_way_comparable_with<Iter1> Iter2>constexpr compare_three_way_result_t<Iter1, Iter2> operator<=>(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);   template<class Iter1, class Iter2>constexprauto operator-(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y)-> decltype(x.base()- y.base());template<class Iter>constexpr move_iterator<Iter> operator+(typename move_iterator<Iter>::difference_type n, const move_iterator<Iter>& x);   template<class Iter>constexpr move_iterator<Iter> make_move_iterator(Iter i);   template<semiregular S>class move_sentinel;   // common iteratorstemplate<input_or_output_iterator I, sentinel_for<I> S> requires (!same_as<I, S>)class common_iterator;   template<class I, class S>struct incrementable_traits<common_iterator<I, S>>;   template<input_iterator I, class S>struct iterator_traits<common_iterator<I, S>>;   // default sentinelsstruct default_sentinel_t;inlineconstexpr default_sentinel_t default_sentinel{};   // counted iteratorstemplate<input_or_output_iterator I>class counted_iterator;   template<class I>struct incrementable_traits<counted_iterator<I>>;   template<input_iterator I>struct iterator_traits<counted_iterator<I>>;   // unreachable sentinelsstruct unreachable_sentinel_t;inlineconstexpr unreachable_sentinel_t unreachable_sentinel{};   // stream iteratorstemplate<class T, class charT =char, class traits = char_traits<charT>, class Distance = ptrdiff_t>class istream_iterator;template<class T, class charT, class traits, class Distance>bool operator==(const istream_iterator<T,charT,traits,Distance>& x, const istream_iterator<T,charT,traits,Distance>& y);   template<class T, class charT =char, class traits = char_traits<charT>>class ostream_iterator;   template<class charT, class traits = char_traits<charT>>class istreambuf_iterator;template<class charT, class traits>bool operator==(const istreambuf_iterator<charT,traits>& a, const istreambuf_iterator<charT,traits>& b);   template<class charT, class traits = char_traits<charT>>class ostreambuf_iterator;   // range accesstemplate<class C>constexprauto begin(C& c)-> decltype(c.begin());template<class C>constexprauto begin(const C& c)-> decltype(c.begin());template<class C>constexprauto end(C& c)-> decltype(c.end());template<class C>constexprauto end(const C& c)-> decltype(c.end());template<class T, size_t N>constexpr T* begin(T (&a)[N])noexcept;template<class T, size_t N>constexpr T* end(T (&a)[N])noexcept;template<class C>constexprauto cbegin(const C& c)noexcept(noexcept(std::begin(c)))-> decltype(std::begin(c));template<class C>constexprauto cend(const C& c)noexcept(noexcept(std::end(c)))-> decltype(std::end(c));template<class C>constexprauto rbegin(C& c)-> decltype(c.rbegin());template<class C>constexprauto rbegin(const C& c)-> decltype(c.rbegin());template<class C>constexprauto rend(C& c)-> decltype(c.rend());template<class C>constexprauto rend(const C& c)-> decltype(c.rend());template<class T, size_t N>constexpr reverse_iterator<T*> rbegin(T (&a)[N]);template<class T, size_t N>constexpr reverse_iterator<T*> rend(T (&a)[N]);template<class E>constexpr reverse_iterator<const E*> rbegin(initializer_list<E> il);template<class E>constexpr reverse_iterator<const E*> rend(initializer_list<E> il);template<class C>constexprauto crbegin(const C& c)-> decltype(std::rbegin(c));template<class C>constexprauto crend(const C& c)-> decltype(std::rend(c));   template<class C>constexprauto size(const C& c)-> decltype(c.size());template<class T, size_t N>constexpr size_t size(const T (&a)[N])noexcept;template<class C>constexprauto ssize(const C& c)-> common_type_t<ptrdiff_t, make_signed_t<decltype(c.size())>>;template<class T, ptrdiff_t N>constexpr ptrdiff_t ssize(const T (&a)[N])noexcept;template<class C>[[nodiscard]]constexprauto empty(const C& c)-> decltype(c.empty());template<class T, size_t N>[[nodiscard]]constexprbool empty(const T (&a)[N])noexcept;template<class E>[[nodiscard]]constexprbool empty(initializer_list<E> il)noexcept;template<class C>constexprauto data(C& c)-> decltype(c.data());template<class C>constexprauto data(const C& c)-> decltype(c.data());template<class T, size_t N>constexpr T* data(T (&a)[N])noexcept;template<class E>constexprconst E* data(initializer_list<E> il)noexcept;}

[編集]コンセプト readable

namespace std {template<class In> concept readable = requires {typename iter_value_t<In>;typename iter_reference_t<In>;typename iter_rvalue_reference_t<In>;}&& common_reference_with<iter_reference_t<In>&&, iter_value_t<In>&>&& common_reference_with<iter_reference_t<In>&&, iter_rvalue_reference_t<In>&&>&& common_reference_with<iter_rvalue_reference_t<In>&&, const iter_value_t<In>&>;}

[編集]コンセプト writable

namespace std {template<class Out, class T> concept writable = requires(Out&& o, T&& t){*o =std::forward<T>(t);// not required to be equality-preserving*std::forward<Out>(o)=std::forward<T>(t);// not required to be equality-preservingconst_cast<const iter_reference_t<Out>&&>(*o)=std::forward<T>(t);// not required to be equality-preservingconst_cast<const iter_reference_t<Out>&&>(*std::forward<Out>(o))=std::forward<T>(t);// not required to be equality-preserving};}

[編集]コンセプト weakly_incrementable

namespace std {template<class T>inlineconstexprbool __is_integer_like =/* see description */;// exposition only   template<class T>inlineconstexprbool __is_signed_integer_like =// exposition only/* see description */;   template<class I> concept weakly_incrementable = default_constructible<I>&& movable<I>&& requires(I i){typename iter_difference_t<I>; requires __is_signed_integer_like<iter_difference_t<I>>;{++i }-> same_as<I&>;// not required to be equality-preserving i++;// not required to be equality-preserving};}

[編集]コンセプト incrementable

namespace std {template<class I> concept incrementable = regular<I>&& weakly_incrementable<I>&& requires(I i){{ i++}-> same_as<I>;};}

[編集]コンセプト input_or_output_iterator

namespace std {template<class I> concept input_or_output_iterator = requires(I i){{*i }-> can-reference;}&& weakly_incrementable<I>;}

[編集]コンセプト sentinel_for

namespace std {template<class S, class I> concept sentinel_for = semiregular<S>&& input_or_output_iterator<I>&& __WeaklyEqualityComparableWith<S, I>;}

[編集]コンセプト sized_sentinel_for

namespace std {template<class S, class I> concept sized_sentinel_for = sentinel_for<S, I>&&!disable_sized_sentinel<remove_cv_t<S>, remove_cv_t<I>>&& requires(const I& i, const S& s){{ s - i }-> same_as<iter_difference_t<I>>;{ i - s }-> same_as<iter_difference_t<I>>;};}

[編集]コンセプト input_iterator

namespace std {template<class I> concept input_iterator = input_or_output_iterator<I>&& readable<I>&& requires {typename/*ITER_CONCEPT*/(I);}&& derived_from</*ITER_CONCEPT*/(I), input_iterator_tag>;}

[編集]コンセプト output_iterator

namespace std {template<class I, class T> concept output_iterator = input_or_output_iterator<I>&& writable<I, T>&& requires(I i, T&& t){*i++=std::forward<T>(t);// not required to be equality-preserving};}

[編集]コンセプト forward_iterator

namespace std {template<class I> concept forward_iterator = input_iterator<I>&& derived_from</*ITER_CONCEPT*/(I), forward_iterator_tag>&& incrementable<I>&& sentinel_for<I, I>;}

[編集]コンセプト bidirectional_iterator

namespace std {template<class I> concept bidirectional_iterator = forward_iterator<I>&& derived_from</*ITER_CONCEPT*/(I), bidirectional_iterator_tag>&& requires(I i){{--i }-> same_as<I&>;{ i--}-> same_as<I>;};}

[編集]コンセプト random_access_iterator

namespace std {template<class I> concept random_access_iterator = bidirectional_iterator<I>&& derived_from</*ITER_CONCEPT*/(I), random_access_iterator_tag>&& totally_ordered<I>&& sized_sentinel_for<I, I>&& requires(I i, const I j, const iter_difference_t<I> n){{ i += n }-> same_as<I&>;{ j + n }-> same_as<I>;{ n + j }-> same_as<I>;{ i -= n }-> same_as<I&>;{ j - n }-> same_as<I>;{ j[n]}-> same_as<iter_reference_t<I>>;};}

[編集]コンセプト contiguous_iterator

namespace std {template<class I> concept contiguous_iterator = random_access_iterator<I>&& derived_from</*ITER_CONCEPT*/(I), contiguous_iterator_tag>&& is_lvalue_reference_v<iter_reference_t<I>>&& same_as<iter_value_t<I>, remove_cvref_t<iter_reference_t<I>>>&& requires(const I& i){{ to_address(i)}-> same_as<add_pointer_t<iter_reference_t<I>>>;};}

[編集]コンセプト indirectly_unary_invocable

namespace std {template<class F, class I> concept indirectly_unary_invocable = readable<I>&& copy_constructible<F>&& invocable<F&, iter_value_t<I>&>&& invocable<F&, iter_reference_t<I>>&& invocable<F&, iter_common_reference_t<I>>&& common_reference_with< invoke_result_t<F&, iter_value_t<I>&>, invoke_result_t<F&, iter_reference_t<I>>>;}

[編集]コンセプト indirectly_regular_unary_invocable

namespace std {template<class F, class I> concept indirectly_regular_unary_invocable = readable<I>&& copy_constructible<F>&& regular_invocable<F&, iter_value_t<I>&>&& regular_invocable<F&, iter_reference_t<I>>&& regular_invocable<F&, iter_common_reference_t<I>>&& common_reference_with< invoke_result_t<F&, iter_value_t<I>&>, invoke_result_t<F&, iter_reference_t<I>>>;}

[編集]コンセプト indirect_unary_predicate

namespace std {template<class F, class I> concept indirect_unary_predicate = readable<I>&& copy_constructible<F>&& predicate<F&, iter_value_t<I>&>&& predicate<F&, iter_reference_t<I>>&& predicate<F&, iter_common_reference_t<I>>;}

[編集]コンセプト indirect_relation

namespace std {template<class F, class I1, class I2 = I1> concept indirect_relation = readable<I1>&& readable<I2>&& copy_constructible<F>&& relation<F&, iter_value_t<I1>&, iter_value_t<I2>&>&& relation<F&, iter_value_t<I1>&, iter_reference_t<I2>>&& relation<F&, iter_reference_t<I1>, iter_value_t<I2>&>&& relation<F&, iter_reference_t<I1>, iter_reference_t<I2>>&& relation<F&, iter_common_reference_t<I1>, iter_common_reference_t<I2>>;}

[編集]コンセプト indirect_strict_weak_order

namespace std {template<class F, class I1, class I2 = I1> concept indirect_strict_weak_order = readable<I1>&& readable<I2>&& copy_constructible<F>&& strict_weak_order<F&, iter_value_t<I1>&, iter_value_t<I2>&>&& strict_weak_order<F&, iter_value_t<I1>&, iter_reference_t<I2>>&& strict_weak_order<F&, iter_reference_t<I1>, iter_value_t<I2>&>&& strict_weak_order<F&, iter_reference_t<I1>, iter_reference_t<I2>>&& strict_weak_order<F&, iter_common_reference_t<I1>, iter_common_reference_t<I2>>;}

[編集]コンセプト indirectly_movable

namespace std {template<class In, class Out> concept indirectly_movable = readable<In>&& writable<Out, iter_rvalue_reference_t<In>>;}

[編集]コンセプト indirectly_movable_storable

namespace std {template<class In, class Out> concept indirectly_movable_storable = indirectly_movable<In, Out>&& writable<Out, iter_value_t<In>>&& movable<iter_value_t<In>>&& constructible_from<iter_value_t<In>, iter_rvalue_reference_t<In>>&& assignable_from<iter_value_t<In>&, iter_rvalue_reference_t<In>>;}

[編集]コンセプト indirectly_copyable

namespace std {template<class In, class Out> concept indirectly_copyable = readable<In>&& writable<Out, iter_reference_t<In>>;}

[編集]コンセプト indirectly_copyable_storable

namespace std {template<class In, class Out> concept indirectly_copyable_storable = indirectly_copyable<In, Out>&& writable<Out, const iter_value_t<In>&>&& copyable<iter_value_t<In>>&& constructible_from<iter_value_t<In>, iter_reference_t<In>>&& assignable_from<iter_value_t<In>&, iter_reference_t<In>>;}

[編集]コンセプト indirectly_swappable

namespace std {template<class I1, class I2 = I1> concept indirectly_swappable = readable<I1>&& readable<I2>&& requires(I1& i1, I2& i2){ ranges::iter_swap(i1, i1); ranges::iter_swap(i2, i2); ranges::iter_swap(i1, i2); ranges::iter_swap(i2, i1);};}

[編集]コンセプト indirectly_comparable

namespace std {template<class I1, class I2, class R, class P1 = identity, class P2 = identity> concept indirectly_comparable = indirect_relation<R, projected<I1, P1>, projected<I2, P2>>;}

[編集]コンセプト permutable

namespace std {template<class I> concept permutable = forward_iterator<I>&& indirectly_movable_storable<I, I>&& indirectly_swappable<I, I>;}

[編集]コンセプト mergeable

namespace std {template<class I1, class I2, class Out, class R = ranges::less, class P1 = identity, class P2 = identity> concept mergeable = input_iterator<I1>&& input_iterator<I2>&& weakly_incrementable<Out>&& indirectly_copyable<I1, Out>&& indirectly_copyable<I2, Out>&& indirect_strict_weak_order<R, projected<I1, P1>, projected<I2, P2>>;}

[編集]コンセプト sortable

namespace std {template<class I, class R = ranges::less, class P = identity> concept sortable = permutable<I>&& indirect_strict_weak_order<R, projected<I, P>>;}

[編集]クラステンプレート std::incrementable_traits

namespace std {template<class>struct incrementable_traits {};   template<class T> requires is_object_v<T>struct incrementable_traits<T*>{using difference_type = ptrdiff_t;};   template<class I>struct incrementable_traits<const I>: incrementable_traits<I>{};   template<class T> requires requires {typename T::difference_type;}struct incrementable_traits<T>{using difference_type =typename T::difference_type;};   template<class T> requires (!requires {typename T::difference_type;}&& requires(const T& a, const T& b){{ a - b }-> integral;})struct incrementable_traits<T>{using difference_type = make_signed_t<decltype(declval<T>()- declval<T>())>;};   template<class T>using iter_difference_t =/* see description */;}

[編集]クラステンプレート std::readable_traits

namespace std {template<class>struct __cond_value_type {};// exposition onlytemplate<class T> requires is_object_v<T>struct __cond_value_type {using value_type = remove_cv_t<T>;};   template<class>struct readable_traits {};   template<class T>struct readable_traits<T*>: __cond_value_type<T>{};   template<class I> requires is_array_v<I>struct readable_traits<I>{using value_type = remove_cv_t<remove_extent_t<I>>;};   template<class I>struct readable_traits<const I>: readable_traits<I>{};   template<class T> requires requires {typename T::value_type;}struct readable_traits<T>: __cond_value_type<typename T::value_type>{};   template<class T> requires requires {typename T::element_type;}struct readable_traits<T>: __cond_value_type<typename T::element_type>{};}

[編集]クラステンプレート std::projected

namespace std {template<readable I, indirectly_regular_unary_invocable<I> Proj>struct projected {using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>; indirect_result_t<Proj&, I> operator*()const;// not defined};   template<weakly_incrementable I, class Proj>struct incrementable_traits<projected<I, Proj>>{using difference_type = iter_difference_t<I>;};}

[編集]クラステンプレート std::iterator_traits

namespace std {template<class I>struct iterator_traits {using iterator_category =/* see description */;using value_type =/* see description */;using difference_type =/* see description */;using pointer =/* see description */;using reference =/* see description */;};   template<class T> requires is_object_v<T>struct iterator_traits<T*>{using iterator_concept = contiguous_iterator_tag;using iterator_category = random_access_iterator_tag;using value_type = remove_cv_t<T>;using difference_type = ptrdiff_t;using pointer = T*;using reference = T&;};}

[編集]イテレータタグ

namespace std {struct input_iterator_tag {};struct output_iterator_tag {};struct forward_iterator_tag:public input_iterator_tag {};struct bidirectional_iterator_tag:public forward_iterator_tag {};struct random_access_iterator_tag:public bidirectional_iterator_tag {};struct contiguous_iterator_tag:public random_access_iterator_tag {};}

[編集]クラステンプレート std::reverse_iterator

namespace std {template<class Iter>class reverse_iterator {public:using iterator_type = Iter;using iterator_concept =/* see description */;using iterator_category =/* see description */;using value_type = iter_value_t<Iter>;using difference_type = iter_difference_t<Iter>;using pointer =typename iterator_traits<Iter>::pointer;using reference = iter_reference_t<Iter>;   constexpr reverse_iterator();constexprexplicit reverse_iterator(Iter x);template<class U>constexpr reverse_iterator(const reverse_iterator<U>& u);template<class U>constexpr reverse_iterator& operator=(const reverse_iterator<U>& u);   constexpr Iter base()const;constexpr reference operator*()const;constexpr pointer operator->()const requires /* see description */;   constexpr reverse_iterator& operator++();constexpr reverse_iterator operator++(int);constexpr reverse_iterator& operator--();constexpr reverse_iterator operator--(int);   constexpr reverse_iterator operator+(difference_type n)const;constexpr reverse_iterator& operator+=(difference_type n);constexpr reverse_iterator operator-(difference_type n)const;constexpr reverse_iterator& operator-=(difference_type n);constexpr/* unspecified */ operator[](difference_type n)const;   friendconstexpr iter_rvalue_reference_t<Iter> iter_move(const reverse_iterator& i)noexcept(/* see description */);template<indirectly_swappable<Iter> Iter2>friendconstexprvoid iter_swap(const reverse_iterator& x, const reverse_iterator<Iter2>& y)noexcept(/* see description */);   protected: Iter current;};}

[編集]クラステンプレート std::back_insert_iterator

namespace std {template<class Container>class back_insert_iterator {protected: Container* container = nullptr;   public:using iterator_category = output_iterator_tag;using value_type =void;using difference_type = ptrdiff_t;using pointer =void;using reference =void;using container_type = Container;   constexpr back_insert_iterator()noexcept=default;constexprexplicit back_insert_iterator(Container& x);constexpr back_insert_iterator& operator=(consttypename Container::value_type& value);constexpr back_insert_iterator& operator=(typename Container::value_type&& value);   constexpr back_insert_iterator& operator*();constexpr back_insert_iterator& operator++();constexpr back_insert_iterator operator++(int);};}

[編集]クラステンプレート std::front_insert_iterator

namespace std {template<class Container>class front_insert_iterator {protected: Container* container = nullptr;   public:using iterator_category = output_iterator_tag;using value_type =void;using difference_type = ptrdiff_t;using pointer =void;using reference =void;using container_type = Container;   constexpr front_insert_iterator(Container& x)noexcept=default;constexprexplicit front_insert_iterator(Container& x);constexpr front_insert_iterator& operator=(consttypename Container::value_type& value);constexpr front_insert_iterator& operator=(typename Container::value_type&& value);   constexpr front_insert_iterator& operator*();constexpr front_insert_iterator& operator++();constexpr front_insert_iterator operator++(int);};}

[編集]クラステンプレート std::insert_iterator

namespace std {template<class Container>class insert_iterator {protected: Container* container = nullptr; ranges::iterator_t<Container> iter = ranges::iterator_t<Container>();   public:using iterator_category = output_iterator_tag;using value_type =void;using difference_type = ptrdiff_t;using pointer =void;using reference =void;using container_type = Container;   insert_iterator()=default;constexpr insert_iterator(Container& x, ranges::iterator_t<Container> i);constexpr insert_iterator& operator=(consttypename Container::value_type& value);constexpr insert_iterator& operator=(typename Container::value_type&& value);   constexpr insert_iterator& operator*();constexpr insert_iterator& operator++();constexpr insert_iterator& operator++(int);};}

[編集]クラステンプレート std::move_iterator

namespace std {template<class Iter>class move_iterator {public:using iterator_type = Iter;using iterator_concept = input_iterator_tag;using iterator_category =/* see description */;using value_type = iter_value_t<Iter>;using difference_type = iter_difference_t<Iter>;using pointer = Iter;using reference = iter_rvalue_reference_t<Iter>;   constexpr move_iterator();constexprexplicit move_iterator(Iter i);template<class U>constexpr move_iterator(const move_iterator<U>& u);template<class U>constexpr move_iterator& operator=(const move_iterator<U>& u);   constexpr iterator_type base()const&;constexpr iterator_type base()&&;constexpr reference operator*()const;constexpr pointer operator->()const;   constexpr move_iterator& operator++();constexprauto operator++(int);constexpr move_iterator& operator--();constexpr move_iterator operator--(int);   constexpr move_iterator operator+(difference_type n)const;constexpr move_iterator& operator+=(difference_type n);constexpr move_iterator operator-(difference_type n)const;constexpr move_iterator& operator-=(difference_type n);constexpr reference operator[](difference_type n)const;   template<sentinel_for<Iter> S>friendconstexprbool operator==(const move_iterator& x, const move_sentinel<S>& y);template<sized_sentinel_for<Iter> S>friendconstexpr iter_difference_t<Iter> operator-(const move_sentinel<S>& x, const move_iterator& y);template<sized_sentinel_for<Iter> S>friendconstexpr iter_difference_t<Iter> operator-(const move_iterator& x, const move_sentinel<S>& y);friendconstexpr iter_rvalue_reference_t<Iter> iter_move(const move_iterator& i)noexcept(noexcept(ranges::iter_move(i.current)));template<indirectly_swappable<Iter> Iter2>friendconstexprvoid iter_swap(const move_iterator& x, const move_iterator<Iter2>& y)noexcept(noexcept(ranges::iter_swap(x.current, y.current)));   private: Iter current;// exposition only};}

[編集]クラステンプレート std::move_sentinel

namespace std {template<semiregular S>class move_sentinel {public:constexpr move_sentinel();constexprexplicit move_sentinel(S s);template<class S2> requires convertible_to<const S2&, S>constexpr move_sentinel(const move_sentinel<S2>& s);template<class S2> requires assignable_from<S&, const S2&>constexpr move_sentinel& operator=(const move_sentinel<S2>& s);   constexpr S base()const;private: S last;// exposition only};}

[編集]クラステンプレート std::common_iterator

namespace std {template<input_or_output_iterator I, sentinel_for<I> S> requires (!same_as<I, S>)class common_iterator {public:constexpr common_iterator()=default;constexpr common_iterator(I i);constexpr common_iterator(S s);template<class I2, class S2> requires convertible_to<const I2&, I>&& convertible_to<const S2&, S>constexpr common_iterator(const common_iterator<I2, S2>& x);   template<class I2, class S2> requires convertible_to<const I2&, I>&& convertible_to<const S2&, S>&& assignable_from<I&, const I2&>&& assignable_from<S&, const S2&> common_iterator& operator=(const common_iterator<I2, S2>& x);   decltype(auto) operator*(); decltype(auto) operator*()const requires dereferenceable<const I>; decltype(auto) operator->()const requires /* see description */;   common_iterator& operator++(); decltype(auto) operator++(int);   template<class I2, sentinel_for<I> S2> requires sentinel_for<S, I2>friendbool operator==(const common_iterator& x, const common_iterator<I2, S2>& y);template<class I2, sentinel_for<I> S2> requires sentinel_for<S, I2>&& equality_comparable_with<I, I2>friendbool operator==(const common_iterator& x, const common_iterator<I2, S2>& y);   template<sized_sentinel_for<I> I2, sized_sentinel_for<I> S2> requires sized_sentinel_for<S, I2>friend iter_difference_t<I2> operator-(const common_iterator& x, const common_iterator<I2, S2>& y);   friend iter_rvalue_reference_t<I> iter_move(const common_iterator& i)noexcept(noexcept(ranges::iter_move(declval<const I&>()))) requires input_iterator<I>;template<indirectly_swappable<I> I2, class S2>friendvoid iter_swap(const common_iterator& x, const common_iterator<I2, S2>& y)noexcept(noexcept(ranges::iter_swap(declval<const I&>(), declval<const I2&>())));   private: variant<I, S> v_;// exposition only};   template<class I, class S>struct incrementable_traits<common_iterator<I, S>>{using difference_type = iter_difference_t<I>;};   template<input_iterator I, class S>struct iterator_traits<common_iterator<I, S>>{using iterator_concept =/* see description */;using iterator_category =/* see description */;using value_type = iter_value_t<I>;using difference_type = iter_difference_t<I>;using pointer =/* see description */;using reference = iter_reference_t<I>;};}

[編集]クラス std::default_sentinel_t

namespace std {struct default_sentinel_t {};}

[編集]クラステンプレート std::counted_iterator

namespace std {template<input_or_output_iterator I>class counted_iterator {public:using iterator_type = I;   constexpr counted_iterator()=default;constexpr counted_iterator(I x, iter_difference_t<I> n);template<class I2> requires convertible_to<const I2&, I>constexpr counted_iterator(const counted_iterator<I2>& x);   template<class I2> requires assignable_from<I&, const I2&>constexpr counted_iterator& operator=(const counted_iterator<I2>& x);   constexpr I base()const& requires copy_constructible<I>;constexpr I base()&&;constexpr iter_difference_t<I> count()constnoexcept;constexpr decltype(auto) operator*();constexpr decltype(auto) operator*()const requires dereferenceable<const I>;   constexpr counted_iterator& operator++(); decltype(auto) operator++(int);constexpr counted_iterator operator++(int) requires forward_iterator<I>;constexpr counted_iterator& operator--() requires bidirectional_iterator<I>;constexpr counted_iterator operator--(int) requires bidirectional_iterator<I>;   constexpr counted_iterator operator+(iter_difference_t<I> n)const requires random_access_iterator<I>;friendconstexpr counted_iterator operator+( iter_difference_t<I> n, const counted_iterator& x) requires random_access_iterator<I>;constexpr counted_iterator& operator+=(iter_difference_t<I> n) requires random_access_iterator<I>;   constexpr counted_iterator operator-(iter_difference_t<I> n)const requires random_access_iterator<I>;template<common_with<I> I2>friendconstexpr iter_difference_t<I2> operator-(const counted_iterator& x, const counted_iterator<I2>& y);friendconstexpr iter_difference_t<I> operator-(const counted_iterator& x, default_sentinel_t);friendconstexpr iter_difference_t<I> operator-( default_sentinel_t, const counted_iterator& y);constexpr counted_iterator& operator-=(iter_difference_t<I> n) requires random_access_iterator<I>;   constexpr decltype(auto) operator[](iter_difference_t<I> n)const requires random_access_iterator<I>;   template<common_with<I> I2>friendconstexprbool operator==(const counted_iterator& x, const counted_iterator<I2>& y);friendconstexprbool operator==(const counted_iterator& x, default_sentinel_t);   template<common_with<I> I2>friendconstexpr strong_ordering operator<=>(const counted_iterator& x, const counted_iterator<I2>& y);   friendconstexpr iter_rvalue_reference_t<I> iter_move(const counted_iterator& i)noexcept(noexcept(ranges::iter_move(i.current))) requires input_iterator<I>;template<indirectly_swappable<I> I2>friendconstexprvoid iter_swap(const counted_iterator& x, const counted_iterator<I2>& y)noexcept(noexcept(ranges::iter_swap(x.current, y.current)));   private: I current = I();// exposition only iter_difference_t<I> length =0;// exposition only};   template<class I>struct incrementable_traits<counted_iterator<I>>{using difference_type = iter_difference_t<I>;};   template<input_iterator I>struct iterator_traits<counted_iterator<I>>: iterator_traits<I>{using pointer =void;};}

[編集]クラス std::unreachable_sentinel_t

namespace std {struct unreachable_sentinel_t {template<weakly_incrementable I>friendconstexprbool operator==(unreachable_sentinel_t, const I&)noexcept{returnfalse;}};}

[編集]クラステンプレート std::istream_iterator

namespace std {template<class T, class CharT =char, class Traits = char_traits<CharT>, class Distance = ptrdiff_t>class istream_iterator {public:using iterator_category = input_iterator_tag;using value_type = T;using difference_type = Distance;using pointer =const T*;using reference =const T&;using char_type = CharT;using traits_type = Traits;using istream_type = basic_istream<CharT, Traits>;   constexpr istream_iterator();constexpr istream_iterator(default_sentinel_t); istream_iterator(istream_type& s); istream_iterator(const istream_iterator& x)=default; ~istream_iterator()=default; istream_iterator& operator=(const istream_iterator&)=default;   const T& operator*()const;const T* operator->()const; istream_iterator& operator++(); istream_iterator operator++(int);   friendbool operator==(const istream_iterator& i, default_sentinel_t);   private: basic_istream<CharT, Traits>* in_stream;// exposition only T value;// exposition only};}

[編集]クラステンプレート std::ostream_iterator

namespace std {template<class T, class CharT =char, classTraits = char_traits<CharT>>class ostream_iterator {public:using iterator_category = output_iterator_tag;using value_type =void;using difference_type = ptrdiff_t;using pointer =void;using reference =void;using char_type = CharT;using traits_type = Traits;using ostream_type = basic_ostream<CharT, Traits>;   constexpr ostreambuf_iterator()noexcept=default; ostream_iterator(ostream_type& s); ostream_iterator(ostream_type& s, const CharT* delimiter); ostream_iterator(const ostream_iterator& x); ~ostream_iterator(); ostream_iterator& operator=(const ostream_iterator&)=default; ostream_iterator& operator=(const T& value);   ostream_iterator& operator*(); ostream_iterator& operator++(); ostream_iterator& operator++(int);   private: basic_ostream<CharT, Traits>* out_stream = nullptr;// exposition onlyconst CharT* delim = nullptr;// exposition only};}

[編集]クラステンプレート std::istreambuf_iterator

namespace std {template<class CharT, class Traits = char_traits<CharT>>class istreambuf_iterator {public:using iterator_category = input_iterator_tag;using value_type = CharT;using difference_type =typename Traits::off_type;using pointer =/* unspecified */;using reference = CharT;using char_type = CharT;using traits_type = Traits;using int_type =typename Traits::int_type;using streambuf_type = basic_streambuf<CharT, Traits>;using istream_type = basic_istream<CharT, Traits>;   class proxy;// exposition only   constexpr istreambuf_iterator()noexcept;constexpr istreambuf_iterator(default_sentinel_t)noexcept; istreambuf_iterator(const istreambuf_iterator&)noexcept=default; ~istreambuf_iterator()=default; istreambuf_iterator(istream_type& s)noexcept; istreambuf_iterator(streambuf_type* s)noexcept; istreambuf_iterator(const proxy& p)noexcept; istreambuf_iterator& operator=(const istreambuf_iterator&)noexcept=default; CharT operator*()const; istreambuf_iterator& operator++(); proxy operator++(int);bool equal(const istreambuf_iterator& b)const;   friendbool operator==(const istreambuf_iterator& i, default_sentinel_t s);   private: streambuf_type* sbuf_;// exposition only};   template<class CharT, class Traits>class istreambuf_iterator<CharT, Traits>::proxy{// exposition only CharT keep_; basic_streambuf<CharT, Traits>* sbuf_; proxy(CharT c, basic_streambuf<CharT, Traits>* sbuf): keep_(c), sbuf_(sbuf){}public: CharT operator*(){return keep_;}};}

[編集]クラステンプレート std::ostreambuf_iterator

namespace std {template<class CharT, class Traits = char_traits<CharT>>class ostreambuf_iterator {public:using iterator_category = output_iterator_tag;using value_type =void;using difference_type = ptrdiff_t;using pointer =void;using reference =void;using char_type = CharT;using traits_type = Traits;using streambuf_type = basic_streambuf<CharT, Traits>;using ostream_type = basic_ostream<CharT, Traits>;   constexpr ostreambuf_iterator()noexcept=default; ostreambuf_iterator(ostream_type& s)noexcept; ostreambuf_iterator(streambuf_type* s)noexcept; ostreambuf_iterator& operator=(CharT c);   ostreambuf_iterator& operator*(); ostreambuf_iterator& operator++(); ostreambuf_iterator& operator++(int);bool failed()constnoexcept;   private: streambuf_type* sbuf_ = nullptr;// exposition only};}

[編集]クラステンプレート std::iterator

namespace std {template<class Category, class T, class Distance = ptrdiff_t, class Pointer = T*, class Reference = T&>struct iterator {typedef Category iterator_category;typedef T value_type;typedef Distance difference_type;typedef Pointer pointer;typedef Reference reference;};}
close