Array can only be used for simple types


Since the ArrayAllocationBase uses malloc instead of new for it’s memory, it can only be used for simple types.

The comments suggest using an OwnedArray, but that has no copy constructor or assignment operator.

Is there anyway to do what I want with a juce class, or should I just use a vector? I hate stl. The syntax is so ugly.


Interesting point, though for some reason I’ve never needed to use it for anything like this myself. It’d require some more template parameters to do more complex allocation for specific types. Might be possible, I guess…


I have a similar aversion to STL. As ‘S’ as it is, i prefer the letter J.

I always need to do stuff with arrays that’s not quite what it caters for by default, so I usually just subclass OwnedArray and add what I need [or, alternatively, wrap it in some other custom class to make a new ‘array’ type].