Constructs a match_results object, which is either default-initialized or with the contents of m (copy/move constructors).
When default-constructed (1), a match_results's object ready member function returns false.
Parameters
alloc
Allocator object to be used instead of constructing a new one.
For class instantiations using their version of the default allocator class template, this parameter is not relevant.
Member type allocator_type is defined in match_results as an alias of its second template parameter (Alloc).
m
Another match_results object of the same type (with the same class template arguments), whose contents are either copied or moved.
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// match_results constructor
// - using cmatch, a standard alias of match_results<const char*>
#include <iostream>
#include <regex>
int main ()
{
std::cmatch m; // default constructor
std::regex_match ( "subject", m, std::regex("sub(.*)") );
std::cmatch mcopy (m); // copy constructor
for (unsigned i=0; i<mcopy.size(); ++i)
std::cout << "match " << i+1 << ": " << mcopy[i] << std::endl;
return 0;
}