regex_replace blocks the compilation

I made a program on MacOS, but now I want to make it compatible with Windows. So I compiled my libraries in Windows, created a Code::Blocks project, and starting adapting some functions and variables that don't suit to Windows.

But there is a function that I don't understand why it doesn't work, regex_replace(). #include didn't give an error. Notice that the first time I compiled it, told me to add "-std=gnu++11" to my compiler options. Here is my function:

1
2
3
#include <regex>
string str = "hey guys";
str = regex_replace(string str, regex("guys"), "girls");


And 'str' is now "hey girls".

But when I compile on Windows, it gives me this error: "no matching function for call to 'regex_replace'". I searched a little bit, but I didn't find anything interesting.

So what should I do? Thank you!
Use this:
1
2
3
#include <regex>
string str = "hey guys";
str = regex_replace(str, regex("guys"), string("girls"));


Tested with VS 2010.
Topic archived. No new replies allowed.