The difference between exception handling in C + + 11 GB Standard and Microsoft's exception handling in Visual Studio 2012

Source: Internet
Author: User
Tags scalar

This piece of code:

__try
{
}
__except(GetErrorCode())
{
}


You can capture a null pointer, but the code that surrounds it cannot have an object with its own destructor. The AUTO_PTR keyword inside the C + + 11 Standard, the exception that occurs when a pointer to this keyword can be

try
{
}
catch(...)
{
}


Capture, but the VC does not support the AUTO_PTR keyword.

From official Microsoft documents, it is customary for Microsoft to use Goto to add a cleanup scalar after return at the end of the function, and jump to cleanup once the code detects an exception. The code behind the cleanup code is typically used to free memory. Otherwise all normal, normal execution to cleanup before. If the normal code and the exception code share the CLEAUP scalar code, the return code is not written before Cleaup.

The difference between exception handling in C + + 11 GB Standard and Microsoft's exception handling in Visual Studio 2012

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.