From 0ba8230b7e4800783b11e5f8a9de69315766480d Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 23 Apr 2025 20:33:27 -0700 Subject: [PATCH] Make Preference implicit conversion operator return a reference Instead of copying. We can let the caller decide if they want to copy. Also helps with #756. --- src/Preference.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Preference.h b/src/Preference.h index f3cd2bbb82..ae74a39203 100644 --- a/src/Preference.h +++ b/src/Preference.h @@ -120,7 +120,7 @@ public: return m_defaultValue; } - operator const T () const + operator const T &() const { return Get(); }