Generic Programming and the STL: Using and Extending the C++ Standard Template Library (Paperback)

Matthew H. Austern

  • 出版商: Addison Wesley
  • 出版日期: 1998-10-13
  • 售價: $2,100
  • 貴賓價: 9.5$1,995
  • 語言: 英文
  • 頁數: 548
  • 裝訂: Paperback
  • ISBN: 0201309564
  • ISBN-13: 9780201309560
  • 相關分類: C++ 程式語言
  • 立即出貨(限量) (庫存=1)

買這商品的人也買了...

商品描述

 

Description

 

Austern's book introduces you to the generic programming paradigm and to the most important instance of that paradigm--the C++ Standard Template Library (STL). This book reveals that the STL is more than a set of convenient container classes: It is also an extensible framework for generic and interoperable components. Austern explains the central ideas underlying generic programming--concepts, modeling, and refinement--and shows how these ideas lead to the fundamental concepts of the STL: iterators, containers, and function objects.

Back to Top


Appropriate Courses

C++ - Intermediate Programming.

Back to Top

 

Table Of Contents

 

Preface.

 

 

I. INTRODUCTION TO GENERIC PROGRAMMING.

 

 

 

1. A Tour of the STL.

 

A Simple Example.
Summary.


2. Algorithms and Ranges.

 

Linear Search.
Linear Search in C.
Ranges.
Linear Search in C++.

Concepts and Modeling.
Iterators.
Input Iterators.
Output Iterators.
Forward Iterators.
Bidirectional Iterators.
Random Access Iterators.

Refinement.
Summary.


3. More about Iterators.

 

 

Iterator Traits and Associated Types.
Value Types.
Difference Type.
Reference and Pointer Types.
Dispatching Algorithms and Iterator Tags.
Putting It All Together.
Iterator Traits without iterator_traits.

Defining New Components.
Iterator Adaptors.
Advice for Defining an Iterator.
Advice for Defining an Algorithm.

Summary.


4. Function Objects.

 

 

Generalizing Linear Search.
Function Object Concepts.
Unary and Binary Function Objects.
Predicates and Binary Predicates.
Associated Types.

Function Object Adaptors.
Predefined Function Objects.
Summary.


5. Containers.

 

 

A Simple Container.
An Array Class.
How It Works.
Finishing Touches.

Container Concepts.
Containment of Elements.
Iterators.
The Hierarchy of Containers.
The Trivial Container.

Variable Size Container Concepts.
Sequences.
Associative Containers.
Allocators.

Summary.
Which Container Should You Use?
Defining Your Own Container.
 

II. REFERENCE MANUAL: STL CONCEPTS.

 

 


6. Basic Concepts.

 

 

Assignable.
Default Constructible.
Equality Comparable.
Ordering.
LessThan Comparable.
Strict Weakly Comparable.


7. Iterators.

 

 

Trivial Iterator.
Input Iterator.
Output Iterator.
Forward Iterator.
Bidirectional Iterator.
Random Access Iterator.


8. Function Objects.

 

 

Basic Function Objects.
Generator.
Unary Function.
Binary Function.

Adaptable Function Objects.
Adaptable Generator.
Adaptable Unary Function.
Adaptable Binary Function.

Predicates.
Predicate.
Binary Predicate.
Adaptable Predicate.
Adaptable Binary Predicate.
Strict Weak Ordering.

Specialized Concepts.
Random Number Generator.
Hash Function.


9. Containers.

 

 

General Container Concepts.
Container.
Forward Container.
Reversible Container.
Random Access Container.

Sequences.
Sequence.
Front Insertion Sequence.
Back Insertion Sequence.

Associative Containers.
Associative Container.
Unique Associative Container.
Multiple Associative Container.
Simple Associative Container.
Pair Associative Container.
Sorted Associative Container.
Hashed Associative Container.

Allocator.
 

III. REFERENCED MANUAL: ALGORITHMS AND CLASSES.

 

 


10. Basic Components.

 

 

pair.
Iterator Primitives.
iterator_traits.
Iterator Tag Classes.
distance.
advance.
Iterator Base Class.

allocator.
Memory Management Primitives.
construct.
destroy.
uninitialized_copy.
uninitialized_fill.
uninitialized_fill_n.

Temporary Buffers.
get_temporary_buffer.
return_temporary_buffer.


11. Nonmutating Algorithms.

 

 

Linear Search.
find.
find_if.
adjacent_find.
find_first_of.

Subsequence Matching.
search.
find_end.
search_n.

Counting Elements.
count.
count_if.

for_each.
Comparing Two Ranges.
equal.
mismatch.
lexicographical_compare.

Minimum and Maximum.
min.
max.
min_element.
max_element.


12. Basic Mutating Algorithms.

 

 

Copying Ranges.
copy.
copy_backward.

Swapping Elements.
swap.
iter_swap.
swap_ranges.

transform.
Replacing Elements.
replace.
replace_if.
replace_copy.
replace_copy_if.

Filling Ranges.
fill.
fill_n.
generate.
generate_n.

Removing Elements.
remove.
remove_if.
remove_copy.
remove_copy_if.
unique.
unique_copy.

Permuting Algorithms.
reverse.
reverse_copy.
rotate.
rotate_copy.
next_permutation.
prev_permutation.

Partitions.
partition.
stable_partition.

Random Shuffling and Sampling.
random_shuffle.
random_sample.
random_sample_n.

Generalized Numeric Algorithms.
accumulate.
inner_product.
partial_sum.
adjacent_difference.


13. Sorting and Searching.

 

 

Sorting Ranges.
sort.
stable_sort.
partial_sort.
partial_sort_copy.
nth_element.
is_sorted.

Operations on Sorted Ranges.
Binary Search.
Merging Two Sorted Ranges.
Set Operations on Sorted Ranges.

Heap Operations.
make_heap.
push_heap.
pop_heap.
sort_heap.
is_heap.


14. Iterator Classes.

 

 

Insert Iterators.
front_insert_iterator.
back_insert_iterator.
insert_iterator.

Stream Iterators.
istream_iterator.
ostream_iterator.
istreambuf_iterator.
ostreambuf_iterator.

reverse_iterator.
raw_storage_iterator.


15. Function Object Classes.

 

 

Function Object Base Classes.
unary_function.
binary_function.

Arithmetic Operations.
plus.
minus.
multiplies.
divides.
modulus.
negate.

Comparisons.
equal_to.
not_equal_to.
less.
greater.
less_equal.
greater_equal.

Logical Operations.
logical_and.
logical_or.
logical_not.

Identity and Projection.
identity.
project1st.
project2nd.
select1st.
select2nd.

Specialized Function Objects.
hash.
subtractive_rng.

Member Function Adaptors.
mem_fun_t.
mem_fun_ref_t.
mem_fun1_t.
mem_fun1_ref_t.
const_mem_fun_t.
const_mem_fun_ref_t.
const_mem_fun1_t.
const_mem_fun1_ref_t.

Other Adaptors.
binder1st.
binder2nd.
pointer_to_unary_function.
pointer_to_binary_function.
unary_negate.
binary_negate.
unary_compose.
binary_compose.


16. Container Classes.

 

 

Sequences.
vector.
list.
slist.
deque.

Associative Containers.
set.
map.
multiset.
multimap.
hash_set.
hash_map.
hash_multiset.
hash_multimap.

Container Adaptors.
stack.
queue.
priority_queue.


Appendix A. Portability and Standardization.

 

 

Language Changes.
The Template Compilation Model.
Default Template Parameters.
Member Templates.
Partial Specialization.
New Keywords.

Library Changes.
Allocators.
Container Adaptors.
Minor Library Changes.

Naming and Packaging.


Bibliography.
Index. 0201309564T04062001


Back to Top

 

 

商品描述(中文翻譯)

描述

Austern的書介紹了泛型編程範式以及該範式中最重要的實例 - C++標準模板庫(STL)。這本書揭示了STL不僅僅是一組方便的容器類:它還是一個可擴展的泛型和互操作組件框架。Austern解釋了泛型編程的核心思想 - 概念、建模和細化 - 並展示了這些思想如何導致STL的基本概念:迭代器、容器和函數對象。

適合的課程

C++ - 中級編程。

目錄

前言。

第一部分:泛型編程入門。

1. STL概述。

2. 算法和範圍。

3. 更多關於迭代器的內容。

(以下省略)