泛型编程与STL(影印版)

泛型编程与STL(影印版)
作 者: Matthew Austern
出版社: 中国电力出版社
丛编项: 原版风暴系列
版权说明: 本书为公共版权或经版权方授权,请支持正版图书
标 签: 暂缺
ISBN 出版时间 包装 开本 页数 字数
未知 暂无 暂无 未知 0 暂无

作者简介

  Matthew H·Austern:拥有博士学位,曾于MIT和UC Berkeley做研究。现任职于Silicon Graphics编译器团队,是SGI STL的主要作者。他是Dr.Dobbs Journal和C++Report两本刊物的撰稿人,并主持newsgroup comp.std.c++,同时也是ISO/ANSI C++标准委员会的一位活跃成员。

内容简介

本书由知名的C++专家MatthewH.Austern执笔,引导你进入泛型编程思维模型,并将你带往此一模型的最重要成品:C++StandardTemplateLibrary(STL)。本书揭示STL的奥秘,告诉你STL不仅仅是一组方便运用的容器类(containerclasses)。对于泛型组件和可交互作用的组件而言,STL是一个具备扩充能力的框架(framework)。许多程序员可能并不知道,C++不仅是一个面向对象程序语言,它还适用于泛型编程(genericprogramming)。这项技术可以大大增强你的能力,协助你写出高效率并可重复运用的软件组件(softwarecomponents)。本书由知名的C++专家MatthewH.Austern执笔,引导你进入泛型编程思维模型,并将你带往此一模型的最重要成品:C++StandardTemplateLibrary(STL)。本书揭示STL的奥秘,告诉你STL不仅仅是一组方便运用的容器类(containerclasses)。对于泛型组件和可交互作用的组件而言,STL是一个具备扩充能力的框架(framework)。本书阐述了泛型编程的中心思想:concepts、modeling、refinement,并为你展示这些思想如何导出STL的基础概念:iterators、containers、functionObjects。循此路线,你可以把STL想像为一个由concepts(而非明确之functions或classes)组成的程序库。你将学习其正式结构并因此获得其潜在威力所带采的完整优势。作者简介MatthewH.Austern:拥有博士学位,曾于MIT和UCBerkeley做研究。现任职于SiliconGraphics编译器团队,是SGISTL的主要作者。他是Dr.Dobb''''sJournal和C++Report两本刊物的撰稿人,并主持newsgroupcomp.std.c++,同时也是ISO/ANSIC++标准委员会的一位活跃成员。

图书目录

Preface

Part I Introduction to Generic Programming

Chapter 1 A Tour of the STL

1.1 A Simple Example

1.2 Summary

Chapter 2 Algorithms and Ranges

2.1 Linear Search

2.1.1 Linear Search tn C

2.1.2 Ranges

2.1.3 Linear Search in C++

2.2 Concepts and Modeling

2.3 Iterators

2.3.1 Input Iterators

2.3.2 Output Iterators

2.3.3 Forward Iterators

2.3.4 Bidirectional Iterators

2.3.5 Random Access Iterators

2.4 Refinement

2.5 Summary

Chapter 3 More about Iterators

3.1 Iterator Traits and Associated Types

3.1.1 Value Types

3.1.2 Difference Type

3.1.3 Reference and Pointer Types

3.1.4 Dispatching Algorithms and Iterator Tags

3.1.5 Putting It All Together

3.1.6 Iterator Traits without iterator_traits

3.2 Defining New Components

3.2.1 Iterator Adaptors

3.2.2 Advice for Defining an Iterator

3.2.3 Advice for Defining an Algorithm

3.3 Summary

Chapter 4 Function Objects

4.1 Generalizing Linear Search

4.2 Function Object Concepts

4.2.1 Unary and Binary Function Objects

4.2.2 Predicates and Binary Predicates

4.2.3 Associated Types

4.3 Function Object Adaptors

4.4 Predefined Function Objects

4.5 Summary

Chapter 5 Containers

5.1 A Simple Container

5.1.1 An Array Class

5.1.2 How It Works

5.1.3 Finishing Touches

5.2 Container Concepts

5.2.1 Containment of Elements

5.2.2 Iterators

5.2.3 The Hierarchy of Containers

5.2.4 The Trivial Container

5.3 Variable Size Container Concepts

5.3.1 Sequences

5.3.2 Associative Containers

5.3.3 Allocators

5.4 Summary

5.4.1 Which Container Should You Use?

5.4.2 Defining Your Own Container

Part II Reference Manual: STL Concepts

Chapter 6 Basic Concepts

6.1 Assignable

6.2 Default Constructible

6.3 Equality Comparable

6.4 Ordering

6.4.1 LessThan Comparable

6.4.2 Strict Weakly Comparable

Chapter 7 Iterators

7.1 Trivial Iterator

7.2 Input Iterator

7.3 Output Iterator

7.4 Forward Iterator

7.5 Bidirectional Iterator

7.6 Random Access Iterator

Chapter 8 Function Objects

B.1 Basic Function Objects

8.1.1 Generator

8.1.2 Unary Function

8.1.3 Binary Function

8.2 Adaptable Function Objects

8.2.1 Adaptable Generator

8.2.2 Adaptable Unary Function

8.2.3 Adaptable Binary Function

8.3 Predicates

8.3.1 Predicate

8.3.2 Binary Predicate

8.3.3 Adaptable Predicate

8.3.4 Adaptable Binary Predicate

8.3.5 Strict Weak Ordering

8.4. Specialized Concepts

8.4.1 Random Number Generator

8.4.2 Hash Function

Chapter 9 Containers

9.1 General Container Concepts

9.1.1 Container

9.1.2 Forward Container

9.1.3 Reversible Container

9.1.4 Random Access Container

9.2 Sequences

9.2.1 Sequence

9.2.2 Front Insertion Sequence

9.2.3 Back Insertion Sequence

9.3 Associative Containers

9.3.1 Associative Container

9.3.2 Unique Associative Container

9.3.3 Multiple Associative Container

9.3.4 Simple Associative Container

9.3.5 Pair Associative Container

9.3.6 Sorted Associative Container

9.3.7 Hashed Associative Container

9.4 Allocator

Part III Reference Manual: Algorithms and Classes

Chapter 10 Basic Components

10.1 pair

10.2 Iterator Primitives

10.2.1 iterator_traits

10.2.2 Iterator Tag Classes

10.2.3 distance

10.2.4 advance

10.2.5 Iterator Base Class

10.3 allocator

10.4 Memory Management Primitives

10.4.1 construct

10.4.2 destroy

10.4.3 uninitialized_copy

10.4.4 uninitialized_fill

10.4.5 uninitialized_fill_n

10.5 Temporary Buffers

10.5.1 get_temporary_buffer

10.5.2 return_temporary_buffer

Chapter 11 Nonmutating Algorithms

11.1 Linear Search

11.1.1 find

11.1.2 find_if

11.1.3 adjacent_find

11.1.4 find_first_of

11.2 Subsequence Matching

11.2.1 search

11.2.2 find_end

11.2.3 search_n

11.3 Counting Elements

11.3.1 count

11.3.2 count_if

11.4 for_each

11.5 Comparing Two Ranges

11.5.1 equal

11.5.2 mismatch

11.5.3 lexicographical_compare

11.6 Minimum and Maximum

11.6.1 rain

11.6.2 max

11.6.3 rain_element

11.6.4 max_element

Chapter 12 Basic Mutating Algorithms

12.1 Copying Ranges

12.1.1 copy

12.1.2 copy_backward

12.2 Swapping Elements

12.2.1 swap

12.2.2 iter_swap

12.2.3 swap_ranges

12.3 transform

12.4 Replacing Elements

12.4.1 replace

12.4.2 replace_if

12.4.3 replace_copy

12.4.4 replace_copy_if

12.5 Filling Ranges

12.5.1 fill

12.5.2 fill_n

12.5.3 generate

12.5.4 generate_n

12.6 Removing Elements

12.6.1 remove

12.6.2 remove_if

12.6.3 remove_copy

12.6.4 remove_copy_if

12.6.5 unique

12.6.6 unique_copy

12.7 Permuting Algorithms

12.7.1 reverse

12.7.2 reverse_copy

12.7.3 rotate

12.7.4 rotate_copy

12.7.5 next_permutation

12.7.6 prev_permutation

12.8 Partitions

12.8.1 partition

12.8.2 stable_partition

12.9 Random Shuffling and Sampling

12.9.1 random_shuffle

12.9.2 random_sample

12.9.3 random_sample_n

12.10 Generalized Numeric Algorithms

12.10.1 accumulate

12.10.2 inner_product

12.10.3 partial_sum

12.10.4 adjacent_difference

Chapter 13 Sorting and Searching

13.1 Sorting Ranges

13.1.1 sort

13.1.2 stable_sort

13.1.3 partial_sort

13.1.4 partial_sort_copy

13.1.5 nth_element

13.1.6 is_sorted

13.2 Operations on Sorted Ranges

13.2.1 Binary Search

13.2.1.1 binary_search

13.2.1.2 lower_bound

13.2.1.3 upper_bound

13.2.1.4 equal_range

13.2.2 Merging Two Sorted Ranges

13.2.2.1 merge

13.2.2.2 inplace_merge

13.2.3 Set Operations on Sorted Ranges

13.2.3.1 includes

13.2.3.2 set_union

13.2.3.3 set_intersection

13.2.3.4 set_difference

13.2.3.5 set_symmetric_difference

13.3 Heap Operations

13.3.1 make_heap

13.3.2 push_heap

13.3.3 pop_heap

13.3.4 sort_heap

13.3.5 is_heap

Chapter 14 Iterator Classes

14.1 Insert Iterators

14.1.1 front_insert_iterator

14.1.2 back_insert_iterator

14.1.3 insert_iterator

14.2 Stream Iterators

14.2.1 istream_iterator

14.2.2 ostream_iterator

14.2.3 istreambuf_iterator

14.2.4 ostreambuf_iterator

14.3 reverse_iterator

14.4 raw_storage_iterator

Chapter 15 Function Object Classes

15.1 Function Object Base Classes

15.1.1 unary_function

15.1.2 binary_function

15.2 Arithmetic Operations

15.2.1 plus

15.2.2 minus

15.2.3 multiplies

15.2.4 divides

15.2.5 modulus

15.2.6 negate

15.3 Comparisons

15.3.1 equal_to

15.3.2 not_equal_to

15.3.3 less

15.3.4 greater

15.3.5 less_equal

15.3.6 greater_equal

15.4 Logical Operations

15.4.1 logical_and

15.4.2 logical_or

15.4.3 logical_not

15.5 Identity and Projection

15.5.1 identity

15.5.2 project1st

15.5.3 project2nd

15.5.4 select1st

15.5.5 select2nd

15.6 Specialized Function Objects

15.6.1 hash

15.6.2 subtractive_rng

15.7 Member Function Adaptors

15.7.1 mem_fun_t

15.7.2 mem_fun_ref_t

15.7.3 mem_fun1_t

15.7.4 mem_fun1_ref_t

15.7.5 const_mem_fun_t

15.7.6 const_mem_fun_ref_t

15.7.7 const_mem_fun1_t

15.7.8 const_mem_fun1_ref_t

15.8 Other Adaptors

15.8.1 binder1st

15.8.2 binder2nd

15.8.3 pointer_to_unary_function

15.8.4 pointer_to_binary_function

15.8.5 unary_negate

15.8.6 binary_negate

15.8.7 unary_compose

15.8.8 binary_compose

Chapter 16 Container Classes

16.1 Sequences

16.1.1 vector

16.1.2 list

16.1.3 slist

16.1.4 deque

16.2 Associative Containers

16.2.1 set

16.2.2 map

16.2.3 multiset

16.2.4 multimap

16.2.5 hash_set

16.2.6 hash_map

16.2.7 hash_multiset

16.2.8 hash_multimap

16.3 Container Adaptors

16.3.1 stack

16.3.2 queue

16.3.3 priority_queue

Appendix A Portability and Standardization

A. 1 Language Changes

A.1.1 The Template Compilation Model

A.1.2 Default Template Parameters

A.1.3 Member Templates

A.1.4 Partial Specialization

A.1.5 New Keywords

A.2 Library Changes

A.2.1 Allocators

A.2.2 Container Adaptors

A.2.3 Minor Library Changes

A.3 Naming and Packaging

Bibliography

Index