To be pedantic, it depends on what MyType
is. If you have typedef char* MyType
and you allocate memory for MyType
, and you want that memory to be owned by the object, then yes, you need a destructor.
Otherwise, you don't need to free memory for anything that wasn't allocated with new
or malloc
, so no.
Your class shouldn't even have a destructor at all. There's a general consensus that you should only have a destructor when you actually need it. Having a destructor also implies implementing an assignment operator and copy constructor (the rule of three). If you're not managing any memory, it's better to rely on the ones provided by the compiler - i.e. the compiler will generate these three if you don't.
Also, your constructor should look like this:
A::A() : x(42), v(5){
}
Otherwise your members will be initialized and then assigned to, which is wasteful.