Question on @nothrow

Vasileios Anagnostopoulos via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 1 06:26:15 PDT 2017


On Wednesday, 31 May 2017 at 17:20:08 UTC, Ali Çehreli wrote:
> On 05/31/2017 02:10 AM, Vasileios Anagnostopoulos wrote:
>
> > compiler enforced @throws
>
> For that to be possible, the compiler would have to see all 
> definitions, which is not possible with separate compilation.
>
> Besides, I think the only meaning of @throws would be "may 
> throw". If so, since the implementation of every function can 
> be changed to call any other function, the possibility of 
> throwing would always exist.
>
> Ali


So the biggest question is, how do I know that a function "may 
throw" an exception in order to use a try/catch/finally block? 
This is my biggest problem (sorry, coming from a java/C 
background).


More information about the Digitalmars-d-learn mailing list