📄 slide035.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="blendTrans(Duration=2)" http-equiv="Page-Enter">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name='Copyright' content='2005 John Wiley & Sons'>
<meta name='Author' content='Kurt Schmidt'>
<script language="JavaScript" src="./config.js"></script>
<script language="JavaScript" src="./pageFormat.js"></script>
<script><!-- // Set title on browser window
title()
//--></script>
</head>
<body>
<div onclick="document.location='slide036.html'">
<h2><font color="#009999">19.3.4 Exceptions and Constructors /
Destructors</font></h2>
<font size="+1">
<ul>
<li>C'tors and d'tors do not return a value</li>
<li>Throwing an exception is a clean way to indicate failure
<ul>
<li><font color="#009999">Caveat:</font> Static values are initialized
before <tt>main</tt> is entered. There is no try block to catch
exceptions</li>
</ul>
</li>
<li>If a c'tor fails, the object is not created
<ul>
<li>The d'tor isn't called</li>
<li>Subtle source of leaks</li>
(See next slide)
</ul>
</li>
<li>Two concurrent exceptions will halt the program
<ul>
<li>Don't throw exceptions from within a d'tor</li>
</ul>
</li>
</ul>
</font>
<hr>
<center><small>
<a href='slide034.html'>prev</a>
|<a href='slide001.html'>top</a>
|<a href='slide036.html'>next</a>
</small></center>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -