2

TR1 から regex_replace を機能させることができませんでした。

#include <iostream>
#include <string>
#include <tr1/regex>

int main()
{
std::string str = "Hello world";
std::tr1::regex rx("world");
std::string replacement = "planet";
std::string str2 = std::tr1::regex_replace(str, rx, replacement);

std::cout << str2 << "\n";
}

str2 は空の文字列です。

4

0 に答える 0