Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

Exception specitication

lostar
Beginner
410 Views
Does Intel Compiler support this feature?
0 Kudos
3 Replies
Ganesh_R_Intel
Employee
410 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
lostar
Beginner
410 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).
ofv
Beginner
410 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.
Reply