I don't suppose there's some fancy stuff that could be done to make this problem:
- The Array class can be used to hold simple, non-polymorphic objects as well as primitive types - to do so, the class must fulfil these requirements:
- it must be able to be relocated in memory by a memcpy without this causing any problems - so objects whose functionality relies on external pointers or references to themselves can not be used.
A compile time error rather than an obscure crash?
Not that I've just spent three hours chasing my tail on a stupid self-inflicted bug ... appears you can't put std::functions<> into juce::Array<> and expect it to work.
Off to understand the differences between vector and Array and check I've actually solved my problem...