I created the following definition
and then in another class, I declared an instance variable of type MidiEventPriorityQueue.
Compilation was fine but linking failed with the error message below. My rusty C++ indicates that the problem is probably that the compiler couldn’t decide which of the existing operator< implementations to use but for the life of me I can’t remember how to (or even if it is possible to) force any of them to be used (the one with the Time type would probably be fine).
I’m not sure why it didn’t just use the operator< defined for MidiMessage itself.
Is it the case that my only alternative is to include a Compare ‘type’ in the priority_queue template and do it myself?
/usr/include/c++/4.2.1/bits/stl_function.h:227:0 /usr/include/c++/4.2.1/bits/stl_function.h:227: error: no match for ‘operator<’ in ‘__x < __y’
note: candidates are:
bool juce::operator<(const juce::Time&, const juce::Time&)
bool juce::operator<(const juce::RelativeTime&, const juce::RelativeTime&)
bool juce::operator<(const juce::String&, const juce::String&)