⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcack.htm

📁 一个非常适合初学者入门的有关c++的文档
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd">
<HTML LANG="EN">
<HEAD>
<TITLE>More Effective C++ | Acknowledgments</TITLE>
<LINK REL=STYLESHEET HREF=../INTRO/ECMEC.CSS>
<SCRIPT LANGUAGE="Javascript" SRC="../JAVA/COOKIE.JS"></SCRIPT>
<SCRIPT LANGUAGE="Javascript">var imagemax = 0; setCurrentMax(0);</SCRIPT>
<SCRIPT LANGUAGE="Javascript" SRC="../JAVA/DINGBATS.JS"></SCRIPT>
<SCRIPT>
var dingbase = "MCACKDIR.HTM";
var dingtext = "MEC++ Acknowl, P";
if (self == top) {
 top.location.replace(dingbase + this.location.hash);
}
</SCRIPT>

</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" ONLOAD="setResize()">
<!-- SectionName="MEC++ Acknowledgments" -->
<DIV ALIGN="CENTER"><FONT SIZE="-1">Back to <A HREF="./MDED_FR.HTM" TARGET="_top">Dedication</A> &nbsp;&nbsp;<BR>&nbsp;&nbsp;Continue to <A HREF="./MCINTRFR.HTM" TARGET="_top">Introduction</A></FONT></DIV>
<A NAME="pxi"></A><A NAME="pxii"></A>
<P>
<A NAME="dingp1"></A><font ID="mgtitle">Acknowledgments</font><SCRIPT>create_link(1);</SCRIPT>
</P>

<A NAME="723"> </A>
<P><A NAME="dingp2"></A>
A great number of people helped bring this book into existence. Some contributed ideas for technical topics, some helped with the process of producing the book, and some just made life more fun while I was working on <NOBR>it.<SCRIPT>create_link(2);</SCRIPT>
</NOBR></P><A NAME="737"> </A>
<P><A NAME="dingp3"></A>
When the number of contributors to a book is large, it is not uncommon to dispense with individual acknowledgments in favor of a generic "Contributors to this book are too numerous to mention." I prefer to follow the expansive lead of John L. Hennessy and David A. Patterson in <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=comparch" onMouseOver="self.status='Computer Architecture: A Quantitative Approach'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>Computer</NOBR> Architecture: A Quantitative Approach</I></A> (Morgan Kaufmann, 1995). In addition to motivating the comprehensive acknowledgments that follow, their book provides hard data for the 90-10 rule, which I refer to in <A HREF="./MC4_FR.HTM#40995" TARGET="_top">Item 16</A>.<SCRIPT>create_link(3);</SCRIPT>
</p>

<P><A NAME="dingp4"></A><font ID="mititle">The Items</font><SCRIPT>create_link(4);</SCRIPT>
</P>

<A NAME="2764"> </A>
<P><A NAME="dingp5"></A>
With the exception of direct quotations, all the words in this book are mine. However, many of the ideas I discuss came from others. I have done my best to keep track of who contributed what, but I know I have included information from sources I now fail to recall, foremost among them many posters to the Usenet newsgroups <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=clcfaq" ONMOUSEOVER ="self.status = 'comp.lang.c++ Newsgroup'; return true" ONMOUSEOUT="self.status=self.defaultStatus" TARGET="_top"><CODE>comp.lang.c++</CODE></NOBR></a> and <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=compstdc" ONMOUSEOVER ="self.status = 'comp.std.c++ Newsgroup'; return true" ONMOUSEOUT="self.status=self.defaultStatus" TARGET="_top"><code>comp.std.c++</CODE></NOBR></a>.<SCRIPT>create_link(5);</SCRIPT>
</P><A NAME="1518"> </A>
<P><A NAME="dingp6"></A>
Many ideas in the C++ community have been developed independently by many people. In what follows, I note only where <I>I</I> was exposed to particular ideas, not necessarily where those ideas <NOBR>originated.<SCRIPT>create_link(6);</SCRIPT>
</NOBR></P><A NAME="2226"> </A>
<P><A NAME="dingp7"></A>
Brian Kernighan suggested the use of macros to approximate the syntax of the new C++ casting operators I describe in <A HREF="./MC1_FR.HTM#77216" TARGET="_top">Item 2</A>.<SCRIPT>create_link(7);</SCRIPT>
</P><A NAME="480"> </A>
<P><A NAME="dingp8"></A>
In <A HREF="./MC1_FR.HTM#84818" TARGET="_top">Item 3</A>, my warning about deleting an array of derived class objects through a base class pointer is based on material in Dan Saks' "Gotchas" talk, which he's given at several conferences and trade <NOBR>shows.<SCRIPT>create_link(8);</SCRIPT>
</NOBR></P><A NAME="794"> </A>
<P><A NAME="dingp9"></A>
<A NAME="pxii"></A>In <A HREF="./MC2_FR.HTM#5970" TARGET="_top">Item 5</A>, the proxy class technique for preventing unwanted application of single-argument constructors is based on material in Andrew Koenig's column in the January 1994 <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=cppreport" onMouseOver="self.status='C++ Report Home Page'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>C++</NOBR> Report</I></A>.<SCRIPT>create_link(9);</SCRIPT>
</P><A NAME="3421"> </A>
<P><A NAME="dingp10"></A>
James Kanze made a posting to <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=clcfaq" ONMOUSEOVER ="self.status = 'comp.lang.c++ Newsgroup'; return true" ONMOUSEOUT="self.status=self.defaultStatus" TARGET="_top"><CODE>comp.lang.c++</CODE></NOBR></a> on implementing postfix increment and decrement operators via the corresponding prefix functions; I use his technique in <A HREF="./MC2_FR.HTM#5262" TARGET="_top">Item 6</A>.<SCRIPT>create_link(10);</SCRIPT>
</P><A NAME="3426"> </A>
<P><A NAME="dingp11"></A>
David Cok, writing me about material I covered in <NOBR><A HREF="../EC/INDEX.HTM" onMouseOver = "self.status = 'Link to Effective C++ Home Page'; return true" onMouseOut = "self.status = self.defaultStatus" TARGET="_top"><I>Effective</NOBR> C++</I></A>, brought to my attention the distinction between <CODE>operator</CODE> <CODE>new</CODE> and the <CODE>new</CODE> operator that is the crux of <A HREF="./MC2_FR.HTM#33985" TARGET="_top">Item 8</A>. Even after reading his letter, I didn't really understand the distinction, but without his initial prodding, I probably <I>still</I> <NOBR>wouldn't.<SCRIPT>create_link(11);</SCRIPT>
</NOBR></P><A NAME="813"> </A>
<P><A NAME="dingp12"></A>
The notion of using destructors to prevent resource leaks (used in <A HREF="./MC3_FR.HTM#5292" TARGET="_top">Item 9</A>) comes from section 15.3 of Margaret A. Ellis' and Bjarne Stroustrup's <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=anncrm" onMouseOver="self.status='Annotated C++ Reference Manual Home Page'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>The</NOBR> Annotated C++ Reference Manual</I></A> (see <a href="MCREADFR.HTM" target="_top">page 285</a>). There the technique is called <I>resource acquisition is initialization</I>. Tom Cargill suggested I shift the focus of the approach from resource acquisition to resource <NOBR>release.<SCRIPT>create_link(12);</SCRIPT>
</NOBR></P><A NAME="1185"> </A>
<P><A NAME="dingp13"></A>
Some of my discussion in <A HREF="./MC3_FR.HTM#39749" TARGET="_top">Item 11</A> was inspired by material in Chapter 4 of <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=talgdp" onMouseOver="self.status='Taligent`s Guide to Designing Programs Home Page'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>Taligent's</NOBR> Guide to Designing Programs</I></A> (Addison-Wesley, <NOBR>1994).<SCRIPT>create_link(13);</SCRIPT>
</NOBR></P><A NAME="451"> </A>
<P><A NAME="dingp14"></A>
My description of over-eager memory allocation for the <CODE>DynArray</CODE> class in <A HREF="./MC4_FR.HTM#41124" TARGET="_top">Item 18</A> is based on Tom Cargill's article, "A Dynamic vector is harder than it looks," in the June 1992 <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=cppreport" onMouseOver="self.status='C++ Report Home Page'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>C++</NOBR> Report</I></A>. A more sophisticated design for a dynamic array class can be found in Cargill's follow-up column in the January 1994 <NOBR><FONT COLOR="#FF0000" SIZE="-2"><B>&deg;</B></FONT><A HREF="http://www.awl.com/cseng/cgi-bin/cdquery.pl?name=cppreport" onMouseOver="self.status='C++ Report Home Page'; return true" onMouseOut="self.status=self.defaultStatus" target="_top"><I>C++</NOBR> Report</I></A>.<SCRIPT>create_link(14);</SCRIPT>
</P><A NAME="441"> </A>
<P>
<A NAME="dingp15"></A>
<A HREF="./MC4_FR.HTM#41187" TARGET="_top">Item 21</A> was inspired by Brian Kernighan's paper, "An AWK to C++ Translator," at the 1991 USENIX C++ Conference. His use of overloaded operators (sixty-seven of them!) to handle mixed-type arithmetic operations, though designed to solve a problem unrelated to the one I explore in <A HREF="./MC4_FR.HTM#41187" TARGET="_top">Item 21</A>, led me to consider multiple overloadings as a solution to the problem of temporary <NOBR>creation.<SCRIPT>create_link(15);</SCRIPT>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -