On 22/05/2014 at 00:06, xxxxxxxx wrote:
Originally posted by xxxxxxxx
Cinema 4D Version: R15
Platform: Windows ;
Mac OSX ;
</ADDRESS> Hello Forum,
Is there a method to test if a maxon::BaseArray has been allocated.
[/DIV][DIV]maxon::BaseArray<Int32> map;[/DIV][DIV]if (!map) return false; // does not compile[/DIV][DIV]
Or is it safe to assume that the BaseArray is always allocated?
Thanks for your help,
You don't have to check this as the object is just created in the current scope, but no memory is allocated yet for the array.
You've to check either
- the return value of Append(), Insert() to see if the operation which triggered a memory allocation was successful
- or the return value of Resize() which triggers memory allocations/releases too