欢迎来到天天文库
浏览记录
ID:34297844
大小:1.19 MB
页数:190页
时间:2019-03-04
《Effective_C (2nd_ED).pdf》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、EffectiveC++,2E,2E
2、ContentsEffectiveC++,SecondEditionContentsDedicationPrefaceAcknowledgmentsIntroductionShiftingfromCtoC++Item1:Preferconstandinlineto#define.Item2:Preferto.Item3:Prefernewanddeletetomallocandfree.Item4:PreferC++-stylecomments.MemoryManagementItem5:Usethesameformi
3、ncorrespondingusesofnewanddelete.Item6:Usedeleteonpointermembersindestructors.Item7:Bepreparedforout-of-memoryconditions.Item8:Adheretoconventionwhenwritingoperatornewandoperatordelete.Item9:Avoidhidingthe"normal"formofnew.Item10:Writeoperatordeleteifyouwriteoperatornew.Constructors,Destructors,andA
4、ssignmentOperatorsItem11:Declareacopyconstructorandanassignmentoperatorforclasseswithdynamicallyallocatedmemory.Item12:Preferinitializationtoassignmentinconstructors.Item13:Listmembersinaninitializationlistintheorderinwhichtheyaredeclared.Item14:Makesurebaseclasseshavevirtualdestructors.Item15:Haveo
5、perator=returnareferenceto*this.file:///E
6、/Resources/C++/effective%20c++/Effective_C+++_CD/Effective_C+++_CD/EC/TOC.HTM(1/3)[2003-6-1120:01:49]EffectiveC++,2E,2E
7、ContentsItem16:Assigntoalldatamembersinoperator=.Item17:Checkforassignmenttoselfinoperator=.ClassesandFunctions:DesignandDeclarationItem18
8、:Striveforclassinterfacesthatarecompleteandminimal.Item19:Differentiateamongmemberfunctions,non-memberfunctions,andfriendfunctions.Item20:Avoiddatamembersinthepublicinterface.Item21:Useconstwheneverpossible.Item22:Preferpass-by-referencetopass-by-value.Item23:Don'ttrytoreturnareferencewhenyoumustret
9、urnanobject.Item24:Choosecarefullybetweenfunctionoverloadingandparameterdefaulting.Item25:Avoidoverloadingonapointerandanumericaltype.Item26:Guardagainstpotentialambiguity.Item27:Explicitlydisallowuseofimplicitlygeneratedmemberfunctionsyoudon'twant.Item28:Partitiontheglobalnamespace.ClassesandFuncti
10、ons:ImplementationItem29:Avoidreturning"handles"tointernaldata.Item30:Avoidmemberfunctionsthatreturnnon-constpointersorreferencestomemberslessaccessiblethanthemselves.Item31:Neverreturnareferencetoalo
此文档下载收益归作者所有