"Invalid operands" error after JUCE 5.3.2 update


#1

I believe this is auto-generated code from the previous JUCE version I was using, but don’t recall (maybe I manually copied and pasted this from elsewhere). I’m unfamiliar with std::unique_ptr, so any quick tips for this issue would be greatly appreciated.


#2

It looks like the Label::Listener autogenerated code is missing a .get(). I’ll add that.

For now, you can fix this by changing if (labelThatHasChanged == bpmValuesLabel) to if (labelThatHasChanged == bpmValuesLabel.get())


#3

Get used to std::unique_ptr as soon as you can, it’s part of C++11 101.


#4

Yeah, I never used it because I always only use raw C++ pointers or one of the JUCE template pointers, never had a need to use the C++ template ones.


#5

@jules, now that this change has been made in the codebase, this bullet point might need updated :slight_smile:

“The juce::ScopedPointer class was written to be compatible with pre-C++11 compilers, so although it does offer C++11 move functionality for supported compilers, it’s not as versatile as std::unique_ptr. So if you can use std::unique_ptr in your own code, that’s probably a better bet. We may eventually migrate the JUCE codebase to std::unique_ptr.”


#6

Is it possible to have this committed into the codebase? The temp fix is fine, but whenever I change something in the GUI and save with the Projucer, the .get() is removed and it has to be manually inserted again.


#7

It was - here. You’ll need to rebuild the Projucer.