std::match_results<BidirIt,Alloc>:: ready
From cppreference.net
<
cpp
|
regex
|
match results
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Regular expressions library
| Classes | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Algorithms | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Iterators | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Exceptions | ||||
|
(C++11)
|
||||
| Traits | ||||
|
(C++11)
|
||||
| Constants | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Regex Grammar | ||||
|
(C++11)
|
std::match_results
| Member functions | ||||
| State | ||||
|
match_results::ready
|
||||
| Element access | ||||
| Iterators | ||||
| Format | ||||
| Modifiers | ||||
| Non-member functions | ||||
|
(until C++20)
|
||||
|
bool
ready
(
)
const
;
|
(C++11以降) | |
マッチ結果が準備完了(有効)かどうかを示します。
デフォルト構築されたマッチ結果は結果状態を持たず( ready ではない)、正規表現アルゴリズムのいずれかによってのみready状態にすることができます。 ready 状態は、すべてのマッチ結果が完全に確立されていることを意味します。
match_results
オブジェクトが
ready
でない状態で、そのメンバー関数のほとんどを呼び出した結果は未定義です。
戻り値
true 一致結果が準備完了の場合、 false それ以外の場合。
例
このコードを実行
#include <iostream> #include <regex> #include <string> int main() { std::string target("big-red-cat"); std::smatch sm; std::cout << "Default constructed smatch is " << (sm.ready() ? "ready.\n" : "not ready.\n"); std::regex re1(".*-red-.*"); std::regex_search(target, sm, re1); std::cout << "After search, smatch is " << (sm.ready() ? "ready.\n" : "not ready.\n"); }
出力:
Default constructed smatch is not ready. After search, smatch is ready.