Lifetime: Allow checking for empty lifetimes

This commit is contained in:
Paul Hollinsky
2022-04-26 12:48:17 -04:00
parent 55d7d5bf17
commit 58700afc73
+4
View File
@@ -25,6 +25,10 @@ public:
rhs.fnOnDeath = std::function<void(void)>();
return *this;
}
// Allow checking for empty Lifetimes
bool empty() const { return fnOnDeath.operator bool(); }
operator bool() const { return empty(); }
private:
std::function<void(void)> fnOnDeath;
};