Open aaronmswan opened 5 years ago
Thank you! Let me though suggest adding a test program so that the new functionality will be covered.
Also, thinking out loud, I'm wondering if we could make the API more general by e.g. making the new argument an element-type pointer: if ==null nothing happens, while non-null value gives the user the option to provide a non-zero value for initialisation? @citibeth - any comments?
Not sure what I think of it in the current context... This is the kind of change that could have unintended consequences. For example, what if someone wants to make blitz::Array<MyStruct,1>
???
I found it useful to have new elements of an array created by resizeAndPreserve zero-initialize on request. For example when performing FFT interpolation. This can be a bit of a pain to do after the fact because multiple regions could need to be zeroed. I suppose this behavior could also be achieved externally to the library by re-implementing most of what resizeAndPreserve currently does.
Testing: passes "make check-testsuite".
Updated documentation.
Grateful for any feedback.