diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-05 12:18:06 +0100 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-05-05 18:56:25 +0100 |
commit | ccd19ed0615bfb300bedc23ac48de7f426a7948e (patch) | |
tree | 24a86e76bbbbb15c24f904040c16f527990f9853 /libs/pbd/pbd | |
parent | 417f63a29e54bc962eeb9e5855656f7f7da8c55f (diff) |
extend PBD::ID API to allow construction and operator== using uint64_t
This is theoretically dangerous, because a PBD::ID is supposed to be unique, and this new constructor
cannot guarantee that. However, the same danger already exists with the std::string-based constructor
Diffstat (limited to 'libs/pbd/pbd')
-rw-r--r-- | libs/pbd/pbd/id.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/pbd/pbd/id.h b/libs/pbd/pbd/id.h index 6c5fcb873e..a597b6512b 100644 --- a/libs/pbd/pbd/id.h +++ b/libs/pbd/pbd/id.h @@ -35,6 +35,7 @@ class LIBPBD_API ID { ID (); ID (std::string); ID (const ID&); + ID (uint64_t); void reset (); @@ -47,6 +48,9 @@ class LIBPBD_API ID { } bool operator== (const std::string&) const; + bool operator== (uint64_t n) const { + return _id == n; + } ID& operator= (std::string); ID& operator= (const ID&); |