Arrays - why no Resize or Redim method?


#1

Am i missing something or does there appear not to be any method that can resize an arrray - similar to redim in VB? .

I realise we have setallocatedsize() but this isnt quite the same.


#2

You don’t need to resize them - they expand/contract when you add/remove things…


#3

but sometimes I need to specifically resize ( downsize) an array to a specific size since i use size() in code to determine how to process certain arrays.

( to explain more fully, i am using JUCE to implement a C++ wrapper for
code originally written in REALbasic ( and then exported into C++ ) which has keywords such as redim() )


#4

So just use removeRange()…


#5

or use std::vector…