Multiple destructors and NoGC exceptions?

Max Haughton maxhaton at gmail.com
Sat Sep 7 18:57:18 UTC 2019


On Saturday, 7 September 2019 at 16:35:50 UTC, welkam wrote:
> Today if a struct goes out scope its destructor will be called 
> (if enabled) no mater what but there are two ways a scope can 
> be exited – normally and trough exception. If we want to do 
> different thing when scope exits normally or trough exception D 
> gives few tools for that. Try finally block and more convenient 
> tool scope statement. While scope statement is good it needs to 
> be written inside the scope your code is running. If you are 
> writing library and you want to do different things when scope 
> exits you need to ask users to write scope statements manually 
> and as we know hope based programming is not a good thing. So 
> here is my idea.
>
> [...]

I'm m not sure if I'm reading this correctly, but are you aware 
of dip1008?


More information about the Digitalmars-d mailing list