Explorar o código

Make operator bools explicit

Michael Ragazzon %!s(int64=6) %!d(string=hai) anos
pai
achega
9a7a5b8592

+ 1 - 1
Include/RmlUi/Core/StringUtilities.h

@@ -196,7 +196,7 @@ public:
 	inline Character operator*() const { return StringUtilities::ToCharacter(p); }
 	inline Character operator*() const { return StringUtilities::ToCharacter(p); }
 
 
 	// Returns false when the iterator is located just outside the valid part of the string.
 	// Returns false when the iterator is located just outside the valid part of the string.
-	inline operator bool() const { return (p != view.begin() - 1) && (p != view.end()); }
+	explicit inline operator bool() const { return (p != view.begin() - 1) && (p != view.end()); }
 
 
 	bool operator==(const StringIteratorU8& other) const { return p == other.p; }
 	bool operator==(const StringIteratorU8& other) const { return p == other.p; }
 	bool operator!=(const StringIteratorU8& other) const { return !(*this == other); }
 	bool operator!=(const StringIteratorU8& other) const { return !(*this == other); }

+ 1 - 1
Include/RmlUi/Core/Texture.h

@@ -87,7 +87,7 @@ public:
 	bool operator==(const Texture&) const;
 	bool operator==(const Texture&) const;
 
 
 	/// Returns true if the underlying resource is set.
 	/// Returns true if the underlying resource is set.
-	operator bool() const;
+	explicit operator bool() const;
 
 
 private:
 private:
 	SharedPtr<TextureResource> resource;
 	SharedPtr<TextureResource> resource;

+ 1 - 1
Source/Core/Pool.h

@@ -77,7 +77,7 @@ public:
 		}
 		}
 		/// Returns true if it is OK to deference or increment this
 		/// Returns true if it is OK to deference or increment this
 		/// iterator.
 		/// iterator.
-		inline operator bool()
+		explicit inline operator bool()
 		{
 		{
 			return (node != nullptr);
 			return (node != nullptr);
 		}
 		}