1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Enforced more comprehensive const-correctness in the JUCE container classes

This commit is contained in:
Tom Poole 2019-05-24 16:56:24 +01:00
parent a988b90aff
commit a9a0f6b92f
35 changed files with 351 additions and 112 deletions

View file

@ -127,10 +127,16 @@ public:
void addElement (const OSCBundle::Element& element) { elements.add (element); }
/** Returns a pointer to the first element of the OSCBundle. */
OSCBundle::Element* begin() const noexcept { return elements.begin(); }
OSCBundle::Element* begin() noexcept { return elements.begin(); }
/** Returns a pointer to the first element of the OSCBundle. */
const OSCBundle::Element* begin() const noexcept { return elements.begin(); }
/** Returns a pointer past the last element of the OSCBundle. */
OSCBundle::Element* end() const noexcept { return elements.end(); }
OSCBundle::Element* end() noexcept { return elements.end(); }
/** Returns a pointer past the last element of the OSCBundle. */
const OSCBundle::Element* end() const noexcept { return elements.end(); }
private:
//==============================================================================

View file

@ -63,12 +63,22 @@ const OSCArgument& OSCMessage::operator[] (const int i) const noexcept
return arguments.getReference (i);
}
OSCArgument* OSCMessage::begin() const noexcept
OSCArgument* OSCMessage::begin() noexcept
{
return arguments.begin();
}
OSCArgument* OSCMessage::end() const noexcept
const OSCArgument* OSCMessage::begin() const noexcept
{
return arguments.begin();
}
OSCArgument* OSCMessage::end() noexcept
{
return arguments.end();
}
const OSCArgument* OSCMessage::end() const noexcept
{
return arguments.end();
}

View file

@ -99,12 +99,22 @@ public:
/** Returns a pointer to the first OSCArgument in the OSCMessage object.
This method is provided for compatibility with standard C++ iteration mechanisms.
*/
OSCArgument* begin() const noexcept;
OSCArgument* begin() noexcept;
/** Returns a pointer to the first OSCArgument in the OSCMessage object.
This method is provided for compatibility with standard C++ iteration mechanisms.
*/
const OSCArgument* begin() const noexcept;
/** Returns a pointer to the last OSCArgument in the OSCMessage object.
This method is provided for compatibility with standard C++ iteration mechanisms.
*/
OSCArgument* end() const noexcept;
OSCArgument* end() noexcept;
/** Returns a pointer to the last OSCArgument in the OSCMessage object.
This method is provided for compatibility with standard C++ iteration mechanisms.
*/
const OSCArgument* end() const noexcept;
/** Removes all arguments from the OSCMessage. */
void clear();