case Token::COMMA:
case Token::BRACKET_OPEN:
case Token::BRACKET_CLOSE:
- return (Token::Type) c;
+ return Token ((Token::Type) c);
case '+': case '-':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
class Tokenizer {
public:
- Tokenizer(std::istream &in) : in(in), isPutback(false) { }
+ explicit Tokenizer(std::istream &in) : in(in), isPutback(false) { }
~Tokenizer() { }
private:
Tokenizer(const Tokenizer &);
};
Token() : type(UNKNOWN), number(0) { }
- Token(Type t) : type(t), number(0) { }
+ explicit Token(Type t) : type(t), number(0) { }
Type type;
std::string str;
}
}
-std::ostream &operator <<(std::ostream &out, Tokenizer::Token::Type t) {
+inline std::ostream &operator <<(std::ostream &out, Tokenizer::Token::Type t) {
out << TokenTypeToString(t);
return out;
}