这个页面说GCC 4.5有C++原始字符串文字:
http://gcc.gnu.org/projects/cxx0x.html
但是当我尝试使用此页面中的语法时:
http://www2.research.att.com/~bs/C++0xFAQ.html#raw-strings
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s = R"[\w\\\w]";
}
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
/opt/local/bin/g++-mp-4.5 -std = gnu ++ 0x -O3 rawstr.cc -o rawstr
rawstr.cc:9:19:错误:原始字符串分隔符
rawstr.cc中的字符'\'无效: 9:5:错误:在程序中迷路'R'
原始字符串的正确语法是什么?