c++effective

  • h2_314646
    了解作者
  • 1.2MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-20 05:32
    上传日期
c++effective,c++经典书籍,开发者必备....
c++effective.rar
  • 爱书吧-2万本图书免费下载.url
    120B
  • C++ Effective STL_.pdf
    1.9MB
  • 打开方式.htm
    6.2KB
内容介绍
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <meta name="generator" content="pdf2htmlEX"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css"> <link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css"> <link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/6286b779ce083560b8e65d74/raw.css"> <script src="https://static.pudn.com/base/js/compatibility.min.js"></script> <script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script> <script> try{ pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({}); }catch(e){} </script> <title></title> </head> <body> <div id="sidebar" style="display: none"> <div id="outline"> </div> </div> <div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/6286b779ce083560b8e65d74/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Content </div><div class="t m0 x2 h3 y2 ff2 fs1 fc0 sc0 ls1 ws0">Containers<span class="_ _0"> </span>...................................................................................................................<span class="_ _0"> </span>1<span class="fs2 ls2"> </span></div><div class="t m0 x3 h3 y3 ff2 fs1 fc0 sc0 ls3 ws1">Item 1.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls4 ws2">Choose your containers with care.<span class="_ _2"></span>..........................................................<span class="_ _0"> </span>1<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x3 h3 y4 ff2 fs1 fc0 sc0 ls3 ws1">Item 2.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls5 ws3">Beware the illusion of containe<span class="ls6 ws4">r-independent code................................<span class="_ _0"> </span>4<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y5 ff2 fs1 fc0 sc0 ls3 ws1">Item 3.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls5 ws5">Make copying cheap and correct fo<span class="ls4 ws2">r objects in containers.....................<span class="_ _0"> </span>9<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y6 ff2 fs1 fc0 sc0 ls3 ws1">Item 4.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span>Call empty instead of checking size() against zero.<span class="_"> </span>.............................<span class="_ _3"> </span>11<span class="fs2 ls2 ws0"> </span></div><div class="t m0 x3 h3 y7 ff2 fs1 fc0 sc0 ls3 ws1">Item 5.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls7 ws6">Prefer range member functions to <span class="ls8 ws7">their single-element counterparts.<span class="_ _2"></span>..<span class="_ _3"> </span>12<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y8 ff2 fs1 fc0 sc0 ls3 ws1">Item 6.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls7 ws6">Be alert for <span class="ff3 ls9 ws0">C++'s </span><span class="ls6 ws4">most vexing parse.<span class="_ _4"></span>..................................................<span class="_ _3"> </span>20<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y9 ff2 fs1 fc0 sc0 ls3 ws1">Item 7.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="lsa ws8">When using containers of newed po<span class="ls4 ws9">inters, remember to delete the </span></span></div><div class="t m0 x3 h3 ya ff2 fs1 fc0 sc0 ls7 ws6">pointers before the container is destroyed.<span class="_ _5"> </span>...........................................................<span class="_ _3"> </span>22</div><div class="t m0 x4 h4 yb ff2 fs2 fc0 sc0 ls2 ws0"> </div><div class="t m0 x3 h3 yc ff2 fs1 fc0 sc0 ls3 ws1">Item 8.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span><span class="ls6 ws4">Never create containers of auto_ptrs.<span class="_"> </span>...................................................<span class="_ _3"> </span>27<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x3 h3 yd ff2 fs1 fc0 sc0 ls3 ws1">Item 9.<span class="fs2 ls2 ws0"> <span class="_ _1"> </span></span>Choose carefully among erasing options.<span class="_ _2"></span>.............................................<span class="_ _0"> </span>29<span class="fs2 ls2 ws0"> </span></div><div class="t m0 x3 h3 ye ff2 fs1 fc0 sc0 lsb wsa">Item 10.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 ws1">Be aware of allocator conventions and restrictions.<span class="_ _3"> </span>.........................<span class="_ _3"> </span>34<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x3 h3 yf ff2 fs1 fc0 sc0 lsb wsa">Item 11.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 ws1">Understand the legitimate uses of<span class="wsb"> custom allocators.<span class="_ _4"></span>.......................<span class="_ _0"> </span>40<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y10 ff2 fs1 fc0 sc0 lsb wsa">Item 12.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls7 wsc">Have realistic expectations about the thread safety of STL containers.</span></div><div class="t m0 x3 h3 y11 ff2 fs1 fc0 sc0 lsc wsd"> 43</div><div class="t m0 x5 h4 y12 ff2 fs2 fc0 sc0 ls2 ws0"> </div><div class="t m0 x2 h3 y13 ff2 fs1 fc0 sc0 ls6 wse">vector and string<span class="_ _4"></span>........................................................................................................<span class="_ _0"> </span>48<span class="fs2 ls2 ws0"> </span></div><div class="t m0 x3 h3 y14 ff2 fs1 fc0 sc0 lsb wsa">Item 13.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 wsf">Prefer vector and string to dynamically allocated arrays..................<span class="_ _0"> </span>48<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x3 h3 y15 ff2 fs1 fc0 sc0 lsb wsa">Item 14.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls8 ws7">Use reserve to avoid unnecessa<span class="ls7 ws6">ry reallocations................................<span class="_ _3"> </span>50<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y16 ff2 fs1 fc0 sc0 lsb wsa">Item 15.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 ws1">Be aware of variations in string implementations.<span class="_ _0"> </span>...........................<span class="_ _0"> </span>52<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x3 h3 y17 ff2 fs1 fc0 sc0 lsb wsa">Item 16.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="lsd ws10">Know how to pass vector and stri<span class="ws11">ng data to legacy APIs.<span class="_"> </span>...............<span class="_ _3"> </span>57<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y18 ff2 fs1 fc0 sc0 lsb wsa">Item 17.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 ws1">Use "the swap trick" to trim<span class="ls4 ws2"> excess capacity.<span class="_ _2"></span>...................................<span class="_ _0"> </span>60<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x3 h3 y19 ff2 fs1 fc0 sc0 lsb wsa">Item 18.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls7 ws12">Avoid using vector&lt;bool&gt;.<span class="_ _3"> </span>...............................................................<span class="_ _3"> </span>62<span class="fs2 ls2 ws0"> </span></span></div><div class="t m0 x2 h3 y1a ff2 fs1 fc0 sc0 ls6 ws4">Associative Containers..............................................................................................<span class="_ _3"> </span>65<span class="fs2 ls2 ws0"> </span></div><div class="t m0 x3 h3 y1b ff2 fs1 fc0 sc0 lsb wsa">Item 19.<span class="fs2 ls2 ws0"> <span class="_ _6"> </span></span><span class="ls3 ws1">Understand the difference betwee<span class="lsd ws11">n equality and equivalence.<span class="_ _4"></span>.........<span class="_ _3"> </span>65<span class="fs2 ls2 ws0"> </span></span></span></div><div class="t m0 x6 h3 y1c ff2 fs1 fc0 sc0 ls2 ws0"> </div><div class="t m0 x7 h3 y1d ff2 fs1 fc0 sc0 ls2 ws0">i</div><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a><a class="l" rel='nofollow' onclick='return false;'><div class="d m1"></div></a></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div> </body> </html>
评论
    相关推荐
    • C++ Primer
      C++经典教程,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++。 对C++基本概念和技术全面而且权威的阐述,对...
    • c++课件
      c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件c++课件
    • C++ PRrimer
      本书是久负盛名的C++经典教程,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++。本版对前一版进行了彻底的...
    • C++
      C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++C++
    • C++ primer
      本文档具有C++ primer 以及 C++ primer 标准答案各一份,内容清晰充实!希望与热爱C++的学友们一起同舟共济,努力学习!
    • C++ primer
      本书是久负盛名的C++经典教程,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++。本版对前一版进行了彻底的...
    • c++yuyanbiancheng
      这是C和C++集成的编程环境!这是C和C++集成的编程环境!这是C和C++集成的编程环境!这是C和C++集成的编程环境!这是C和C++集成的编程环境!
    • effective C++
      有关C++编程方面的检验性介绍,对由C转向C++,和有C++编程基础的程序员有帮助,不过是英文版
    • C++ Primer
      这本处适合各个阶段的C++程序员,这本书可以帮助初学者快速入门,里面有最实用,最容易理解的代码;同时这也是有经验的C++程序员最好的一本参考手册
    • C++ Primer
      本书是久负盛名的C++经典教程引,其内容是C++大师Stanley B. Lippman丰富的实践经验和C++标准委员会原负责人Josée Lajoie对C++标准深入理解的完美结合,已经帮助全球无数程序员学会了C++