Is it possible to prevent stack allocation of an object and only allow it to be instiated with \'new\' on the heap?
You could make the constructor private, then provide a public static factory method to create the objects.
private
public