A throw-expression with no operand in C++
2011-05-26 14:35
351 查看
A throw-expression with no operand re-throws the exception currently being handled. Such an expression should appear only in a catch handler or in a function called from within a catch handler. The re-thrown exception object is the original exception object (not a copy). For example:
An empty throw statement tells the compiler that the function does not throw any exceptions. It is the equivalent to using __declspec(nothrow). For example:
try { throw CSomeOtherException(); } catch(...) { // Handle all exceptions // Respond (perhaps only partially) to exception // ... throw; // Pass exception to some other handler }[/code]
An empty throw statement tells the compiler that the function does not throw any exceptions. It is the equivalent to using __declspec(nothrow). For example:
// exceptions_trycatchandthrowstatements3.cpp void empty() throw() { puts("In empty()"); } void with_type() throw(int) { puts("Will throw an int"); throw(1); } int main() { try { empty(); with_type(); }catch (int){ puts("Caught an int"); } }[/code]
相关文章推荐
- [c++] exception with no throw
- Send string in PUT request with libcurl in C++
- OpenOffice.org Code Snippets--Working with a Presentation Document in C++
- Windows XP Targeting with C++ in Visual Studio 2012
- 关于No mapping found for HTTP request with URI [访问路径] in DispatcherServlet with dispatche
- rectify propeties in c++ coding with opencv
- Longest Substring Without Repeating Characters 7 lines with c++ in 12ms
- No mapping found for HTTP request with URI [/service/model/xxx/json] in DispatcherServlet
- Error:"No method with signature" in OAF
- wireshark:no interface can be used for capturing in this system with the current configuration
- No mapping found for HTTP request with URI [/SuperPowerfulProject/login.do] in DispatcherServlet wit
- IDEA启动WEB项目访问Controller一直提示错误:No mapping found for HTTP request with URI [xxxx] in DispatcherServlet
- no mapping found for http request with uri in dispatcherservlet with name
- nsthread autoreleased with no pool in place – just leaking警告的解决方法
- KEIL在Build的时候提示Error:L6406E:No space in execution regions with .ANY selector matching 错误
- springmvc No mapping found for HTTP request with URI in Dispatc
- Regular Expressions in C++ with Boost.Regex(2)
- opencv1.0安装 ../../cxcore/include/cxmisc.h:133:6: error: #elif with no expression
- Compilation with Make in Caffe.ImportError: No module named _caffe
- ISO C++ forbids declaration of * with no type