From 5db01482ebba4c1efe7edb50e2e42fdb4c4453b8 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Wed, 22 Jan 2025 17:49:52 +0100 Subject: [PATCH] Lazy: Fix bool --- src/includes/lazy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/includes/lazy.h b/src/includes/lazy.h index de3deb28d..ad2763552 100644 --- a/src/includes/lazy.h +++ b/src/includes/lazy.h @@ -54,8 +54,8 @@ class Lazy { T* operator->() const { return get(); } - // Returns true if the object is not yet initialized. - explicit operator bool() const { return ptr_; } + // Returns true if the object is initialized. + explicit operator bool() const { return ptr_ != nullptr; } // Deletes the underlying object and will re-run the initialization function if the object is requested again. void reset() { ptr_.reset(); }