上传者: xiaoting451292510
|
上传时间: 2022-05-07 10:30:56
|
文件大小: 17.37MB
|
文件类型: PDF
泛型编程与STL
本书阐述了泛型编程的中心思想:concepts、modeling、refinement,并为你展示这些思想如何导出STL的基础概念:iterators、containers、functionObjects。循此路线,你可以把STL想像为一个由concepts(而非明确之functions或classes)组成的程序库。你将学习其正式结构并因此获得其潜在威力所带采的完整优势。
内容简介
许多程序员可能并不知道,C++不仅是一个面向对象程序语言,它还适用于泛型编程(genericprogramming)。这项技术可以大大增强你的能力,协助你写出高效率并可重复运用的软件组件(softwarecomponents)。
本书由知名的C++专家MatthewH.Austern执笔,引导你进入泛型编程思维模型,并将你带往此一模型的最重要成品:C++StandardTemplateLibrary(STL)。本书揭示STL的奥秘,告诉你STL不仅仅是一组方便运用的容器类(containerclasses)。对于泛型组件和可交互作用的组件而言,STL是一个具备扩充能力的框架(framework)。
编辑本段
作者简介
MatthewH.Austern:拥有博士学位,曾于MIT和UCBerkeley做研究。现任职于SiliconGraphics编译器团队,是SGISTL的主要作者。他是Dr.Dobb'sJournal和C++Report两本刊物的撰稿人,并主持newsgroupcomp.std.c++,同时也是ISO/ANSIC++标准委员会的一位活跃成员。
编辑本段
目录
Preface
PartIIntroductiontoGenericProgramming
Chapter1ATouroftheSTL
1.1ASimpleExample
1.2Summary
Chapter2AlgorithmsandRanges
2.1LinearSearch
2.2ConceptsandModeling
2.3Iterators
2.4Refinement
2.5Summary
Chapter3MoreaboutIterators
3.1IteratorTraitsandAssociatedTypes
3.2DefiningNewComponents
3.3Summary
Chapter4FunctionObjects
4.1GeneralizingLinearSearch
4.2FunctionObjectConcepts
4.3FunctionObjectAdaptors
4.4PredefinedFunctionObjects
4.5Summary
Chapter5Containers
5.1ASimpleContainer
5.2ContainerConcepts
5.3VariableSizeContainerConcepts
5.4Summary
PartIIReferenceManual:STLConcepts
Chapter6BasicConcepts
6.1Assignable
6.2DefaultConstructible
6.3EqualityComparable
6.4Ordering
Chapter7Iterators
7.1TrivialIterator
7.2InputIterator
7.3OutputIterator
7.4ForwardIterator
7.5BidirectionalIterator
7.6RandomAccessIterator
Chapter8FunctionObjects
8.1BasicFunctionObjects
8.2AdaptableFunctionObjects
8.3Predicates
8.4.SpecializedConcepts
Chapter9Containers
9.1GeneralContainerConcepts
9.2Sequences
9.3AssociativeContainers
9.4Allocator
PartIIIReferenceManual:AlgorithmsandClasses
Chapter10BasicComponents
10.1pair
10.2IteratorPrimitives
10.3allocator
10.4MemoryManagementPrimitives
10.5TemporaryBuffers
Chapter11NonmutatingAlgorithms
11.1LinearSearch
11.2SubsequenceMatching
11.3CountingElements
11.4for_each
11.5ComparingTwoRanges
11.6MinimumandMaximum
Chapter12BasicMutatingAlgorithms
12.1CopyingRanges
12.2SwappingElements
12.3transform
12.4ReplacingElements
12.5FillingRanges
12.6RemovingElements
12.7PermutingAlgorithms
12.8Partitions
12.9RandomShufflingandSampling
12.10GeneralizedNumericAlgorithms
Chapter13SortingandSearching
13.1SortingRanges
13.2OperationsonSortedRanges
13.3HeapOperations
Chapter14IteratorClasses
14.1InsertIterators
14.2StreamIterators
14.3reverse_iterator
14.4raw_storage_iterator
Chapter15FunctionObjectClasses
15.1FunctionObjectBaseClasses
15.2ArithmeticOperations
15.3Comparisons
15.4LogicalOperations
15.5IdentityandProjection
15.6SpecializedFunctionObjects
15.7MemberFunctionAdaptors
15.8OtherAdaptors
Chapter16ContainerClasses
16.1Sequences
16.2AssociativeContainers
16.3ContainerAdaptors
AppendixAPortabilityandStandardization
A.1LanguageChanges
A.2LibraryChanges
A.3NamingandPackaging
Bibliography
Index