nothrow in druntime win32 C bindings

Phil Lavoie maidenphil at hotmail.com
Fri Dec 28 05:29:00 PST 2012


On Thursday, 27 December 2012 at 18:16:35 UTC, Andrej Mitrovic 
wrote:
> On 12/27/12, Walter Bright <newshound2 at digitalmars.com> wrote:
>> Is it an issue as you describe? Yes. Is it a big enough issue 
>> to merit a
>> language change? I doubt it.
>
> Ok, but we should at least document it. Currently we only have 
> a small
> remark in the docs saying exceptions in D are not compatible 
> with C++
> exceptions, but we should clarify and maybe add how to work 
> around
> this, whether to catch Throwable, and what to do when its 
> caught.

So, if I got this right, doing this is not ideal:
extern( Windows ) nothrow LRESULT WndProc( HWND hwnd, UINT 
message, WPARAM wParam, LPARAM lParam ) {
try {
...
} catch( Exception e ) { ... }
}

And should be changed to :
catch( Throwable t ) { ... }
?

Thanks,
Phil


More information about the Digitalmars-d mailing list