Possibly a fair point but that was just an example, I’m actually returning an unsigned long from a function. With or without the U suffix, Xcode (at least) complains that setColour() doesn’t take an ‘unsigned int’ as an argument.
The point is (I think) that you’d need to write:
…rather than simply
If the declaration
you could just call:
and the Colour constructor would be called implicitly (a bit like using a C string where Juce expects a Juce String and more recently a MidiMessage where a MidiBuffer is expected). The ‘explicit’ keyword means the constructor will not be called implicitly.
But as Jules says, he probably had some reason for it which may or may not still be a problem. Often this is where there are ambiguities arising from overloaded functions.