ScopedPointer box = new MyComponent(…);
trigger this error in gcc 4.4.3:
Libraries/Juce/src/containers/…/containers/juce_ScopedPointer.h:173: error: ‘juce::ScopedPointer::ScopedPointer(const juce::ScopedPointer&) [with ObjectType = juce::MyCompon
ent]’ is private
Even if the compiler shouldn’t have to call the copy constructor here (as “A a = 3;” is supposed to be the same as “A a(3);”), it still checks if it’s accessible.
both microsoft compiler, and previous GCC accept this with no error BTW.
Move the copy constructor to a public part, and apply transfert semantics (that is, const_cast the “other” and set it’s internal pointer to 0 without deleting it).