欢迎来到天天文库
浏览记录
ID:32348011
大小:3.27 MB
页数:522页
时间:2019-02-03
《斯坦福数学教程》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、classFunctionBase{public:/*Polymorphicclassesneedvirtualdestructors.*/virtual~FunctionBase(){}/*Callsthestoredfunction.*/virtualRetexecute(constArg&val)=0;virtualFunctionBase*clone()const=0;};/*Templatederivedclassthatexecutesaspecifictypeoffunction.*/template2、meUnaryFunction>classFunctionImpl:publicFunctionBase{public:explicitFunctionImpl(UnaryFunctionfn):fn(fn){}CS106LvirtualRetexecute(constArg&val){returnfn(val);}StandardC++ProgrammingLaboratoryvirtualFunctionImpl*clone()const{returnnewFunctionImpl(*this);}UnaryFunction3、fn;};CourseReaderFall2010KeithSchwarzStanfordUniversityAcknowledgements_________________________________________________________________________________________________________Thiscoursereaderrepresentstheculminationoftwoyears'workonCS106Landitscoursehandouts.Neither4、theclassnorthisreaderwouldhavebeenpossiblewithoutJulieZelenski'ssupportandgenerosityduringCS106L'sinfancy.IstronglyencourageyoutotakeoneofJulie'sclasses–youwillnotbedisappointed.I'dalsoliketoextendthankstoalloftheCS106LstudentsI'vehadthepleasureofteachingovertheyears5、.ItistrulyajoytowatchstudentslightupwhentheyseeexactlywhatC++cando.Thelonghoursthatwentintothiscoursereaderwouldnothavebeenpossiblewithouttheknowledgethatstudentsaregenuinelyinterestedinthematerial.Additionally,Iwouldliketothankthebravesoulswhoweregenerousenoughtopro6、ofreaddraftversionsofthiscoursereader.YinHuangandStevenWuofferedparticularlyaptadviceonstyleandgrammar.IlyaShermangavewonderfulsuggestionsontypesettingandlayoutandcaughtmanyerrorsthatslippedundermyradar.KyleKnutsonhelpeddouble-checkthecorrectnessofthecodeintheextende7、dexamples.DavidGoldblatthelpedmestayontopofrecentdevelopmentsinC++0xandpointedouthowtomakemanyoftheSTLpracticeproblemstruertothespiritofthelibrary.SamSchreiberprovidedexcellentadviceabouttheoverallstructureofthereaderandwastheinspirationforthe“CritiquingClassDesign”c8、hapter.LeonidShamisastutelysuggestedthatIexpandthesectionondevelopmentenvironments.BrittneyFraser'samazingfeedbackmademanyoftheexam
2、meUnaryFunction>classFunctionImpl:publicFunctionBase{public:explicitFunctionImpl(UnaryFunctionfn):fn(fn){}CS106LvirtualRetexecute(constArg&val){returnfn(val);}StandardC++ProgrammingLaboratoryvirtualFunctionImpl*clone()const{returnnewFunctionImpl(*this);}UnaryFunction
3、fn;};CourseReaderFall2010KeithSchwarzStanfordUniversityAcknowledgements_________________________________________________________________________________________________________Thiscoursereaderrepresentstheculminationoftwoyears'workonCS106Landitscoursehandouts.Neither
4、theclassnorthisreaderwouldhavebeenpossiblewithoutJulieZelenski'ssupportandgenerosityduringCS106L'sinfancy.IstronglyencourageyoutotakeoneofJulie'sclasses–youwillnotbedisappointed.I'dalsoliketoextendthankstoalloftheCS106LstudentsI'vehadthepleasureofteachingovertheyears
5、.ItistrulyajoytowatchstudentslightupwhentheyseeexactlywhatC++cando.Thelonghoursthatwentintothiscoursereaderwouldnothavebeenpossiblewithouttheknowledgethatstudentsaregenuinelyinterestedinthematerial.Additionally,Iwouldliketothankthebravesoulswhoweregenerousenoughtopro
6、ofreaddraftversionsofthiscoursereader.YinHuangandStevenWuofferedparticularlyaptadviceonstyleandgrammar.IlyaShermangavewonderfulsuggestionsontypesettingandlayoutandcaughtmanyerrorsthatslippedundermyradar.KyleKnutsonhelpeddouble-checkthecorrectnessofthecodeintheextende
7、dexamples.DavidGoldblatthelpedmestayontopofrecentdevelopmentsinC++0xandpointedouthowtomakemanyoftheSTLpracticeproblemstruertothespiritofthelibrary.SamSchreiberprovidedexcellentadviceabouttheoverallstructureofthereaderandwastheinspirationforthe“CritiquingClassDesign”c
8、hapter.LeonidShamisastutelysuggestedthatIexpandthesectionondevelopmentenvironments.BrittneyFraser'samazingfeedbackmademanyoftheexam
此文档下载收益归作者所有