Browse Source

Make operator bools explicit

Michael Ragazzon 6 years ago
parent
commit
9a7a5b8592
3 changed files with 3 additions and 3 deletions
  1. 1 1
      Include/RmlUi/Core/StringUtilities.h
  2. 1 1
      Include/RmlUi/Core/Texture.h
  3. 1 1
      Source/Core/Pool.h

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

@@ -196,7 +196,7 @@ public:
 	inline Character operator*() const { return StringUtilities::ToCharacter(p); }
 
 	// 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 !(*this == other); }

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

@@ -87,7 +87,7 @@ public:
 	bool operator==(const Texture&) const;
 
 	/// Returns true if the underlying resource is set.
-	operator bool() const;
+	explicit operator bool() const;
 
 private:
 	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
 		/// iterator.
-		inline operator bool()
+		explicit inline operator bool()
 		{
 			return (node != nullptr);
 		}