#include <iostream>
#include <cstring>
using namespace std;

class my {
public:
	int x;

	my() { 
		x = 0; 
		std::cout << "constructor called" << std::endl;
	}

	~my() { 
		std::cout << "destructor called" << std::endl;
	}
};

int main() {
	auto mem = malloc(sizeof(my));
	if (mem) {
		auto myPtr = new(mem) my;
		
		myPtr->~my();
		free(mem);
	}
}
