that is a feature what destructors and SBRM are fir

available in standard library extensions TS2, as scope guards, but not approved to std for the better.(I am the author)

if there is a simple enough library solution, why should there be a language extension. 

watch a recording of one of my "what classes we design and how" to learn when destructors and clean up are actually desirable. 

sent from a mobile device so please excuse strange words due to autocorrection. 
Peter Sommerlad
peter.cpp@sommerlad.ch
+41-79-432 23 32

On 1 May 2022, at 09:52, Abdullah Qasim via Std-Proposals <std-proposals@lists.isocpp.org> wrote:



 

try {
  something();
} catch (...) {
  std::cerr << "exception caught!!";
}
 
std::clog << "No except caught!";
 
finally {                  // already Microsoft extension, but
  cleanup();             // should be in core language
}

 

 

--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals