This symbol seems to be a compiler generated destructor. What is the difference between this one, 'compiler generated destructor' and 'scalar deleting destructor'? Are there any other types of compiler generated ctor/dtor?
What is the meaning of symbol "vector deleting destructor" in VC++?
Asked Answered
Functions named 'scalar deleting destructor'
and 'vector deleting destructor'
are helper functions created by VC compiler when generating code for delete
statement. Don't confuse them with the class destructor which also may be generated by the compiler.
The former can be expressed in pseudocode as
void scalar_deleting_destructor(A* pa)
{
pa->~A();
A::operator delete(pa);
}
and the latter as
void vector_deleting_destructor(A* pa, size_t count)
{
for (size_t i = 0; i < count; ++i)
pa[i].~A();
A::operator delete[](pa);
}
@Bainite Let me try to make it more clear.
delete a
is a delete statement, i.e. a language construct, which is not to be confused with A::operator delete
which is a delete operator, a function which actually deallocates the memory. I don't have the C++ standard at hand right now, I could provide references a bit later. –
Bridgework © 2022 - 2025 — McMap. All rights reserved.
delete a
, is this right? Seems the inner call to delete causes recursion? – Bainite