What is the meaning of the symbol "vector that removes the destructor" in VC ++?

This symbol is represented by the compiler generated by the destructor. What is the difference between this, "compiler-generated destructor" and "scalar destructor removal"? Are there other types of compilers generated by ctor / dtor?

+7
source share
1 answer

Functions named 'scalar deleting destructor' and 'vector deleting destructor' are helper functions created by the VC compiler when generating code for the delete operator. Do not confuse them with a class destructor, which can also be generated by the compiler. The first can be expressed in pseudo-code as

 void scalar_deleting_destructor(A* pa) { pa->~A(); A::operator delete(pa); } 

and the last 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); } 
+8
source

All Articles