TAILIEUCHUNG - ansi C reference phần 9

Xử lý cho một khối thử cố gắng trong thứ tự xuất hiện. Điều đó làm cho nó có thể viết xử lý mà không bao giờ có thể được thực thi, ví dụ bằng cách đặt một xử lý cho một lớp học có nguồn gốc sau khi một xử lý cho một lớp cơ sở tương ứng. | 15- 4 Exception handling DRAFT 28 April 1995 Handling an exception 3 4 5 6 7 8 9 10 11 12 13 14 1 void f try g catch Overflow oo . catch Matherr mm . Here the Overflow handler will catch exceptions of type Overflow and the Matherr handler will catch exceptions of type Matherr and all types publicly derived from Matherr including Underflow and Zerodivide. The handlers for a try block are tried in order of appearance. That makes it possible to write handlers that can never be executed for example by placing a handler for a derived class after a handler for a corresponding base class. A . in a handler s exception-declaration functions similarly to . in a function parameter declaration it specifies a match for any exception. If present a . handler shall be the last handler for its try block. If no match is found among the handlers for a try block the search for a matching handler continues in a dynamically surrounding try block. An exception is considered handled upon entry to a handler. Note the stack will have been unwound at that point. If no matching handler is found in a program the function terminate is called. Whether or not the stack is unwound before calling terminate is implementation-defined. Referring to any non-static member or base class of the object in the handler of a function-try-block of a constructor or destructor of the object results in undefined behavior. The fully constructed base classes and members of an object shall be destroyed before entering the handler of a function-try-block of a constructor or destructor for that object. The scope and lifetime of the parameters of a function or constructor extend into the handlers of a function-try-block. If the handlers of a function-try-block contain a jump into the body of a constructor or destructor the program is ill-formed. If a return statement appears in a handler offunction-try-block of a constructor the program is ill-formed. The exception being handled shall be rethrown if control

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.