[Bug libstdc++/53561] New: [c++0x] regex_replace is missing overloads
luto at mit dot edu
gcc-bugzilla@gcc.gnu.org
Sat Jun 2 02:06:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53561
Bug #: 53561
Summary: [c++0x] regex_replace is missing overloads
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: luto@mit.edu
[re.alg.replace] says:
template <class traits, class charT, class ST, class SA>
basic_string<charT, ST, SA>
regex_replace(const basic_string<charT, ST, SA>& s,
const basic_regex<charT, traits>& e,
const charT* fmt,
regex_constants::match_flag_type flags =
regex_constants::match_default);
This doesn't compile, though:
#include <string>
#include <regex>
int main()
{
std::regex_replace<std::regex_traits<char>, char>(std::string("x"),
std::regex("x"), "y"); // works
std::regex_replace(std::string("x"), std::regex("x"), "y"); // fails
return 0;
}
The string,regex,string,flags overload doesn't work because the arguments
aren't an exact match.
More information about the Gcc-bugs
mailing list