Namespaces
Variants

std::match_results<BidirIt,Alloc>:: match_results

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
match_results ( ) : match_results ( Allocator ( ) ) { }
(1)
explicit match_results ( const Allocator & a ) ;
(2)
match_results ( const match_results & rhs ) ;
(3)
match_results ( const match_results & rhs, const Allocator & a ) ;
(4)
match_results ( match_results && rhs ) noexcept ;
(5)
match_results ( match_results && rhs, const Allocator & a ) ;
(6)
1,2) 確立された結果状態を持たないマッチ結果を構築します。
1) デフォルトコンストラクタ。
2) アロケータとして a のコピーを使用してマッチ結果を構築します。
構築が完了すると、 ready() false を返し、 size() 0 を返します。
3-6) rhs からマッチ結果を構築します。
3) コピーコンストラクタ。
4) アロケータとして a のコピーを使用してマッチ結果を構築します。
5) ムーブコンストラクタ。構築が完了すると、 rhs は有効だが未規定の状態になります。
6) アロケータとして a のコピーを使用してマッチ結果を構築します。構築が完了すると、 rhs は有効だが未規定の状態になります。
構築前の rhs の値を m とし、 [ 0 , m. size ( ) ) 内の任意の整数を n とするとき、構築完了後、以下のメンバ関数は指定された値を返すべきです:
メンバ関数
ready() m. ready ( )
size() m. size ( )
str(n) m. str ( n )
prefix() m. prefix ( )
suffix() m. suffix ( )
operator[](n) m [ n ]
length(n) m. length ( n )
position(n) m. position ( n )

目次

パラメータ

a - このコンテナのすべてのメモリ割り当てに使用するアロケータ
rhs - 初期化ソースとして使用する別の match_results オブジェクト

例外

1-4) 実装定義の例外をスローする可能性があります。
6) a == rhs. get_allocator ( ) true の場合、例外を送出しない。

不具合報告

以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR 適用対象 公開時の動作 正しい動作
LWG 2191 C++11 n オーバーロード (3-6) の事後条件でnが負になる可能性があった 非負のみ可能
LWG 2195 C++11 AllocatorAwareContainer で要求されるコンストラクタが欠落していた 追加された
P0935R0 C++11 デフォルトコンストラクタがexplicitであった 暗黙的になった