diff --git a/modules/juce_core/containers/juce_NamedValueSet.cpp b/modules/juce_core/containers/juce_NamedValueSet.cpp index 94ea828bed..1c3efa4a2c 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.cpp +++ b/modules/juce_core/containers/juce_NamedValueSet.cpp @@ -39,7 +39,7 @@ struct NamedValueSet::NamedValue { } - NamedValue (Identifier&& n, var&& v) + NamedValue (Identifier&& n, var&& v) noexcept : name (static_cast (n)), value (static_cast (v)) { @@ -114,6 +114,11 @@ int NamedValueSet::size() const noexcept return values.size(); } +bool NamedValueSet::isEmpty() const noexcept +{ + return values.isEmpty(); +} + const var& NamedValueSet::operator[] (const Identifier& name) const noexcept { if (const var* v = getVarPointer (name)) diff --git a/modules/juce_core/containers/juce_NamedValueSet.h b/modules/juce_core/containers/juce_NamedValueSet.h index 21b75b0e31..80f99ed12a 100644 --- a/modules/juce_core/containers/juce_NamedValueSet.h +++ b/modules/juce_core/containers/juce_NamedValueSet.h @@ -63,6 +63,9 @@ public: /** Returns the total number of values that the set contains. */ int size() const noexcept; + /** Returns true if the set is empty. */ + bool isEmpty() const noexcept; + /** Returns the value of a named item. If the name isn't found, this will return a void variant. @see getProperty