Member predicate NewOrNewArrayExpr :: getInitializer
operator new, this gets the call or expression that initializes the allocated object, if any.
As examples, for
new int(4), this will be
4, and for
new std::vector(4), this will
be a call to the constructor
4 as an argument.
operator new, this gets the call or expression that initializes the first element of the
array, if any.
This will either be a call to the default constructor for the array’s element type (as
new std::string), or a literal zero for arrays of scalars which are zero-initialized
due to extra parentheses (as in
At runtime, the constructor will be called once for each element in the array, but the constructor call only exists once in the AST.
Expr getInitializer ( )