use convenience function

This commit is contained in:
Tiago Gomes 2012-04-16 21:48:13 +01:00
parent 6ab5a4668b
commit 5e88510a7d

View File

@ -17,13 +17,13 @@ using namespace std;
class Symbol class Symbol
{ {
public: public:
Symbol (void) : id_(numeric_limits<unsigned>::max()) { } Symbol (void) : id_(Util::maxUnsigned()) { }
Symbol (unsigned id) : id_(id) { } Symbol (unsigned id) : id_(id) { }
operator unsigned (void) const { return id_; } operator unsigned (void) const { return id_; }
bool valid (void) const { return id_ != numeric_limits<unsigned>::max(); } bool valid (void) const { return id_ != Util::maxUnsigned(); }
static Symbol invalid (void) { return Symbol(); } static Symbol invalid (void) { return Symbol(); }