We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a2d89c commit 9580b19Copy full SHA for 9580b19
include/oup/observable_unique_ptr.hpp
@@ -382,6 +382,13 @@ class observer_ptr : private std::weak_ptr<T> {
382
return std::weak_ptr<T>::lock().get();
383
}
384
385
+ /// Check if this pointer points to a valid object.
386
+ /** \return 'true' if the pointed object is valid, 'false' otherwise
387
+ */
388
+ explicit operator bool() noexcept {
389
+ return !expired();
390
+ }
391
+
392
/// Swap the content of this pointer with that of another pointer.
393
/** \param other The other pointer to swap with
394
*/
0 commit comments