This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/53561] New: [c++0x] regex_replace is missing overloads
- From: "luto at mit dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 02 Jun 2012 02:06:25 +0000
- Subject: [Bug libstdc++/53561] New: [c++0x] regex_replace is missing overloads
- Auto-submitted: auto-generated
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.