diff --git a/modules/juce_blocks_basics/blocks/juce_Block.h b/modules/juce_blocks_basics/blocks/juce_Block.h index b7460746b9..6828b5f30f 100644 --- a/modules/juce_blocks_basics/blocks/juce_Block.h +++ b/modules/juce_blocks_basics/blocks/juce_Block.h @@ -34,7 +34,6 @@ public: virtual ~Block(); /** The different block types. - @see Block::getType() */ enum Type @@ -70,14 +69,18 @@ public: using UID = uint64; /** This Block's UID. - This will be globally unique, and remains constant for a particular device. */ const UID uid; //============================================================================== - /** Returns the type of this device. + /** Two blocks are considered equal if they have the same UID. */ + bool operator== (const Block& other) const noexcept { return uid == other.uid; } + /** Two blocks are considered equal if they have the same UID. */ + bool operator!= (const Block& other) const noexcept { return uid != other.uid; } + //============================================================================== + /** Returns the type of this device. @see Block::Type */ virtual Type getType() const = 0; @@ -314,6 +317,7 @@ public: for (int i = 0; i < numOptionNames; ++i) optionNames[i] = other.optionNames[i]; } + return *this; }