C++ Exceptions
Introduction
The decision to use exceptions is not one to be taken lightly in any language. In C++ the issues are complicated by the difficulties of correctly handling resources such as the free store. We therefore make this separate course available as a supplement to our C++ courses.
Duration and Construction
The course lasts one day, starting at 09.30 and finishing at 17.00. The delivery is via lecture, practical exercise and discussion.
Intended Audience
Participants should already have a good knowledge of C++ and object technology. Ideally they will have attended the Advanced C++ (C++ Traps and Pitfalls) course.
Aims
- To understand why exception mechanisms might be necessary in languages
- To understand how a naïve use of exceptions can make things worse instead of better
- To learn when to use and when not to use exceptions
- To learn some of the techniques to ensure exception-safety and exception-neutrality
- To pursue one example class from first design to true exception -neutrality and exception-safety
Deliverables
- Lectures
- Facilitation of discussions
- Direction, assistance and feedback during practicals
- Proposed solutions for the practicals
- Copies of lecture slides, plus explanatory text and summaries
- Reference list of books and sources
Numbers
We recommend that there are no more than 10 participants, with the best results usually obtained when there are at least 5 participants.
Contents
- The need for, and nature of, exceptions
- C++ exceptions, and the syntax of both sides (try-catch and throw) of exception handling
- Exception handling strategies and tactics
- Standard library exceptions
- The traps and pitfalls of functions that throw, of functions that catch and of functions that provoke exceptions they neither consider nor catch
- Templates and their amplification of exception challenges
- Construction and destruction and exceptions
- Memory management and auto_ptr
- The puzzle of throw specifications in C++
- Cargill's challenge (of making an apparently simple class exception-safe and exception-neutral)
- Safety guidelines
Site Requirements
- One PC with Visual C++ (version 6 or .NET), per participant (including one for the lecturer), preferably networked and with a printer
- Data projector of at least 1024 x 768 resolution, and suitable screen
- White-board, preferably not doubling up as the OHP's screen; blackboard and chalk are acceptable
- Flip-chart and easel, with additional flip-chart paper
Contacting
Please contact Matrice by telephone on +44 7010 704705; by fax on +44 7010 704706; by emailing bookings@matrice.co.uk; or by visiting http://www.matrice.co.uk
Questions or problems regarding this web site should be
directed to webmaster@matrice.co.uk.
Copyright © 2005 Matrice. All rights reserved.
Last modified:
Tuesday, 07-Jun-2005