Bug 53561 - [c++0x] regex_replace is missing overloads
Summary: [c++0x] regex_replace is missing overloads
Status: RESOLVED DUPLICATE of bug 53631
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-02 02:06 UTC by Andy Lutomirski
Modified: 2023-07-20 11:26 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Lutomirski 2012-06-02 02:06:25 UTC
[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.
Comment 1 Andy Lutomirski 2012-06-02 02:09:16 UTC
Never mind.  I just saw that the implementation isn't supposed to be done.
Comment 2 Matthias Vallentin 2012-07-21 17:51:57 UTC
(In reply to comment #1)
> Never mind.  I just saw that the implementation isn't supposed to be done.

The documentation still mentions that regex_replace is not yet implemented:

    /** @todo Implement this function. */

Any ideas when we can start using it?

    Matthias
Comment 3 Jonathan Wakely 2012-07-21 18:00:16 UTC
When someone contributes an implementation of it.
Comment 4 Jonathan Wakely 2023-07-20 11:26:04 UTC
.

*** This bug has been marked as a duplicate of bug 53631 ***