diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-02-27 09:45:11 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-02-27 09:45:11 +0100 |
commit | 0a076efd1b2b1cb2d57fd583af8031039ba03158 (patch) | |
tree | a4b453c942728b936ca3a6e114ce2324476913d1 | |
parent | de9762d5443b8a957fae781bbdc4a740cc6c4e6f (diff) |
pkgcache: Add operator bool() to map_pointer
-rw-r--r-- | apt-pkg/pkgcache.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h index 288bcce09..d2e2f432e 100644 --- a/apt-pkg/pkgcache.h +++ b/apt-pkg/pkgcache.h @@ -102,6 +102,7 @@ public: map_pointer(nullptr_t) noexcept : val(0) {} explicit map_pointer(uint32_t n) noexcept : val(n) {} explicit operator uint32_t() noexcept { return val; } + explicit operator bool() noexcept { return val != 0; } }; template<typename T> inline T *operator +(T *p, map_pointer<T> m) { return p + uint32_t(m); } |