Browse Source

Variant: Improve documentation for equals()

v6.1.6
reuk 4 years ago
parent
commit
317083d409
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      modules/juce_core/containers/juce_Variant.h

+ 11
- 0
modules/juce_core/containers/juce_Variant.h View File

@@ -147,6 +147,17 @@ public:
/** Returns true if this var has the same value as the one supplied.
Note that this ignores the type, so a string var "123" and an integer var with the
value 123 are considered to be equal.
Note that equality checking depends on the "wrapped" type of the object on which
equals() is called. That means the following code will convert the right-hand-side
argument to a string and compare the string values, because the object on the
left-hand-side was initialised from a string:
@code var ("123").equals (var (123)) @endcode
However, the following code will convert the right-hand-side argument to a double
and compare the values as doubles, because the object on the left-hand-side was
initialised from a double:
@code var (45.6).equals ("45.6000") @endcode
@see equalsWithSameType
*/
bool equals (const var& other) const noexcept;


Loading…
Cancel
Save