while writting some C++ code i got to a point, where a certain structure needs an end() function call, to guarantee that the destruction is not throwing any exceptions.
Foo a(x,y)
~a  -> may throw under certain really bad circumstances
Foo a(x,y)
a.end() -> maybe throws
~a gurantees to not throw an exception
I wonder if there is an elegant way to force this constraint (end must be called before Deconstruction) by the compiler or at least print out a warning?
Greetings and thanks
 
     
     
    