How will you write constructor such that it will deallocate memory when there is exception?