diff --git a/include/icsneo/api/lifetime.h b/include/icsneo/api/lifetime.h index 702a259..4c9c959 100644 --- a/include/icsneo/api/lifetime.h +++ b/include/icsneo/api/lifetime.h @@ -25,6 +25,10 @@ public: rhs.fnOnDeath = std::function(); return *this; } + + // Allow checking for empty Lifetimes + bool empty() const { return fnOnDeath.operator bool(); } + operator bool() const { return empty(); } private: std::function fnOnDeath; };