I'll go first:
This code "explicity" calls both the destructor and constructor inside a call to itself.Code:#include <iostream> class Test { public: Test() { std::cout << "Construct" << std::endl; } ~Test() { std::cout << "Destruct" << std::endl; } void Refresh() { this->~Test(); new ((void*)this) Test(); } }; int main(void) { Test test; test.Refresh(); return 0; }
doesn't seem like it should work does it?!?!