1
它的工作,但现在它不再工作,我不知道为什么。预期类型 - 操作员功能
我有这样的代码:
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <cstddef>
std::string operator"" _quoted(const char* text, std::size_t len) {
return "\"" + std::string(text, len) + "\"";
}
和编译过程中,我有这样的错误:
error: expected a type
std::string operator"" _quoted(const char* text, std::size_t len) {
^
,这是 “”,它以红色突出显示。
我真的不明白发生了什么,以及它不再工作的原因是什么。
你能帮我吗?
谢谢
你错过了'-std = C++ 11'吗? – P0W
仍在编译C++ 11? –
谢谢大家指出我。事实上,我的CMakeList中的选项已被删除。所以我又添加了-std = C++ 11编译选项,现在一切正常。 谢谢! – lilouch