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

Indicates if the match results are ready (valid) or not.

# Declarations

bool ready() const;

(since C++11)

# Return value

true if the match results are ready, false otherwise.

# Example

#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");
}