我刚开始在我的 MacBook Pro 上使用 AppCode 2.5.5 进行 c++ 编码。问题是 IDE 一直显示错误警告,但(我认为)没有错误。
那是 Token_stream.h
#include <string>
#include <iostream>
using namespace std;
enum class Kind : char {
name,
number,
end,
plus = '+',
minus = '-',
mul = '*',
div = '/',
print = ';',
assign = '=',
lp = '(',
rp = ')'
};
struct Token {
Kind kind;
string string_value;
double number_value;
};
class Token_stream {
private:
void close();
istream *ip;
bool owns;
Token ct {Kind::end};
public:
Token_stream(istream &s) : ip {&s}, owns {false} {}
Token_stream(istream *p) : ip {p}, owns {true} {}
~Token_stream();
Token get();
const Token& current();
void set_input(istream &s);
void set_input(istream *p);
};
double error(const string &s);
AppCode 一直说Token ct {Kind::end};中缺少“ ; ”
谁能告诉我发生了什么?
这是屏幕截图的链接:https ://app.box.com/s/jgdeufoi2f32aaj00gh9
谢谢。