Value initialization and Non POD types
问题 An hour ago I posted an answer here which according to me was correct. However my answer was downvoted by Martin B. He said You\'re just lucky and are getting zeros because the memory that i was placed in happened to be zero-initialized. This is not guaranteed by the standard. However after reading Michael Burr\'s answer here and trying the following sample code 1) #include <cassert> struct B { ~B(); int m; }; int main() { B * b = new B(); assert(b->m == 0); } I got a debug error on MSVC++