Skip to content

Commit

Permalink
libdeng2: Added NoneId utility
Browse files Browse the repository at this point in the history
Id that is initialized to None, unlike the regular Id which is given
a unique identifier in its constructor.
  • Loading branch information
skyjake committed May 1, 2014
1 parent cf5cc6a commit c6e1029
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions doomsday/libdeng2/include/de/core/id.h
Expand Up @@ -103,6 +103,16 @@ DENG2_PUBLIC QTextStream &operator << (QTextStream &os, Id const &id);

inline uint qHash(Id const &id) { return id; }

/**
* Utility for declaring identifiers that are initially uninitialized.
*/
class DENG2_PUBLIC NoneId : public Id
{
public:
NoneId() : Id(None) {}
NoneId(Id const &other) : Id(other) {}
};

} // namespace de

#endif // LIBDENG2_ID_H

0 comments on commit c6e1029

Please sign in to comment.