samedi 28 mai 2016

G++-5 tr1/regex regex_replace could not be resolved

I am using G++-5 with the dialect option -std=c++0x and the preprocessor symbol __GXX_EXPERIMENTAL_CXX0X__ and I am trying to use the tr1/regex.

I use #include <tr1/regex> with using namespace std::tr1; and regex reg("<[^>]*>"); trows no error. Only when I use regex_replace(line, reg, ""); afterwards, I get the following error output:

Function 'regex_replace' could not be resolved  test.cpp    /cppUni/src line 72 Semantic Error

Invalid arguments '
Candidates are:
#0 regex_replace(#0, #1, #1, const std::tr1::basic_regex<#3,#2> &, const ? &, std::bitset<unsigned long int11>)
? regex_replace(const ? &, const std::tr1::basic_regex<#1,#0> &, const ? &, std::bitset<unsigned long int11>)
'   test.cpp    /cppUni/src line 72 Semantic Error

I verified, that line is a String.

I searched for a solution the last couple of hours and could only find solutions that involved what I attempted. Unfortunately I can't use the boost/regex package.

Is there a solution for this issue?

Aucun commentaire:

Enregistrer un commentaire