Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Exception specitication

lostar
Beginner
1,364 Views
Does Intel Compiler support this feature?
0 Kudos
3 Replies
Ganesh_R_Intel
Employee
1,364 Views
You mean as in ISO 15.4?
The answer is not yet.

Can you please tell me if this is very important to you? Could you please also tell me if you care more about non-empty exception specification - as in throw(int) or just the empty exception specification, as in throw() and what would work for you.

Regards,
Ganesh
0 Kudos
lostar
Beginner
1,364 Views
Foreword ... :)
Quotation from Intel C++ Compiler Documentation(ver 7):
Language Conformance Options->Conformance to the C++ Standart
The Intel C++ Compiler conforms to the ANSI/ISO standard (ISO/IEC 14882:1998) for the C++ language, however, the export keyword for templates is not implemented. For compatibility with Microsoft Visual C++*, the compiler also supports many extensions to the C++ language. For more information, see the Microsoft Visual C++ documentation.
There no words about exception specification and behaviour of set_unexpected function.

>>Can you please tell me if this is very important to you?
Yes, undoubtedly.

>>Could you please also tell me if you care more about >>non-empty exception specification - as in throw(int) or
>>just the empty exception specification, as in throw() Yes, non-empty as
void loadImage throw(bad_format, cant_find_convertor)
{ ... }

and empty exception specification.
Also unexpected handler if throw unspecified exception(see set_unexpected).

>>and what would work for you.
How use exception handling without exception specification? Write some comment in function/method description?
Now we simply write exception specification for each function/method(although it doesn't supported with compiler) but it non effective because runtime check doestn't work(MSVC6/7 and Intel C++ Compiler).
0 Kudos
ofv
Beginner
1,364 Views
I think you are confusing C++ with something else (Java?). Exception handling works perfectly without exception specifications. In fact, exception handling is quite easier without exception specifications. When you don't provide an exception specification, that function is allowed to throw any exception. Exception specifications are a maintenance nightmare, among other bad things. Check comp.lang.c++.moderated for extensive discussions about that (mis)feature.
0 Kudos
Reply