From 2613762ac2c6221318448db3104bc5029b200cb5 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Fri, 5 Sep 2025 16:24:45 -0400 Subject: [PATCH] InternalThreadState: Make bool operator explicit We definitely don't want the boolean null test to be able to be implicitly converted (e.g. to an int or whatever else). For example a non-explicit bool operator allows for silly things like: NonMovableUniquePtr<...> ptr; // ... auto k = 5 + ptr; to build without issue, which we should really force the user to be explicit about if it's *really* a desired behavior. --- FEXCore/include/FEXCore/Debug/InternalThreadState.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FEXCore/include/FEXCore/Debug/InternalThreadState.h b/FEXCore/include/FEXCore/Debug/InternalThreadState.h index e5e53f44c..de4c12b1b 100644 --- a/FEXCore/include/FEXCore/Debug/InternalThreadState.h +++ b/FEXCore/include/FEXCore/Debug/InternalThreadState.h @@ -71,7 +71,7 @@ struct NonMovableUniquePtr { return Ptr; } - operator bool() const noexcept { + explicit operator bool() const noexcept { return Ptr != nullptr; }