added a bool operator to entity class

This commit is contained in:
Sascha Kuehl 2024-03-27 07:38:42 +01:00
parent 4a04a678f9
commit 5d06a13775
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,8 @@ public:
pointer get() { return obj_.get(); } pointer get() { return obj_.get(); }
const value_type* get() const { return obj_.get(); } const value_type* get() const { return obj_.get(); }
operator bool() const { return obj_.get() != nullptr; } // NOLINT(*-explicit-constructor)
private: private:
std::shared_ptr<value_type> obj_; std::shared_ptr<value_type> obj_;
}; };