This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/53561] New: [c++0x] regex_replace is missing overloads


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]