Share via


nothrow (Windows CE 5.0)

Send Feedback

The __declspec( nothrow ) extended storage-class modifier tells the compiler that the declared function and the functions it calls never throw an exception.

With the synchronous exception handling model, now the default, the compiler can eliminate the mechanics of tracking the lifetime of unwindable objects in such a function, and significantly reduce code size.

The following three declarations are equivalent:

#define WINAPI __declspec(nothrow) __stdcall 

void WINAPI foo1();
void __declspec(nothrow) __stdcall foo2();
void __stdcall foo3() throw();

Using void __declspec(nothrow)__stdcall foo2(); has the advantage that you can use an API definition, such as the illustrated by the #define statement, to easily specify nothrow on a set of functions.

The third declaration, void __stdcall foo3() throw(); is the syntax defined by the C++ standard.

See Also

__declspec

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.