A
abort <cstdlib>
accumulate <numeric>
allocator <memory>
array <array>
auto_ptr <memory>
B
back_inserter <iterator>
bad_alloc <new>
bad_array_new_length <new>
bad_cast <typeinfo>
begin <iterator>
bernoulli_distribution <random>
bind <functional>
bitset <bitset>
boolalpha <iostream>
C
cerr <iostream>
cin <iostream>
cmatch <regex>
copy <algorithm>
count <algorithm>
count_if <algorithm>
cout <iostream>
cref <functional>
csub_match <regex>
D
dec <iostream>
default_float_engine <iostream>
default_random_engine <random>
deque <deque>
domain_error <stdexcept>
E
end <iterator>
endl <iostream>
ends <iostream>
equal_range <algorithm>
exception <exception>
F
fill <algorithm>
fill_n <algorithm>
find <algorithm>
find_end <algorithm>
find_first_of <algorithm>
find_if <algorithm>
fixed <iostream>
flush <iostream>
for_each <algorithm>
forward <utility>
forward_list <forward_list>
free <cstdlib>
front_inserter <iterator>
fstream <fstream>
function <functional>
G
get <tuple>
getline <string>
greater <functional>
H
hash <functional>
hex <iostream>
hexfloat <iostream>
I
ifstream <fstream>
initializer_list <initializer_list>
inserter <iterator>
internal <iostream>
ios_base <iosbase>
isalpha <cctype>
islower <cctype>
isprint <cctype>
ispunct <cctype>
isspace <cctype>
istream <iostream>
istream_iterator <iterator>
istringstream <sstream>
isupper <cctype>
L
left <iostream>
less <functional>
less_equal <functional>
list <list>
logic_error <stdexcept>
lower_bound <algorithm>
lround <cmath>
M
make_move_iterator <iterator>
make_pair <utility>
make_shared <memory>
make_tuple <tuple>
malloc <cstdlib>
map <map>
max <algorithm>
max_element <algorithm>
mem_fn <functional>
min <algorithm>
move <utility>
multimap <map>
multiset <set>
negate <functional>
noboolalpha <iostream>
normal_distribution <random>
noshowbase <iostream>
noshowpoint <iostream>
noskipws <iostream>
not1 <functional>
nothrow <new>
nothrow_t <new>
nounitbuf <iostream>
nouppercase <iostream>
nth_element <algorithm>
O
oct <iostream>
ofstream <fstream>
ostream <iostream>
ostream_iterator <iterator>
ostringstream <sstream>
out_of_range <stdexcept>
P
pair <utility>
partial_sort <algorithm>
placeholders <functional>
placeholders::_1 <functional>
plus <functional>
priority_queue <queue>
ptrdiff_t <cstddef>
Q
queue <queue>
R
rand <random>
random_device <random>
range_error <stdexcept>
ref <functional>
regex <regex>
regex_constants <regex>
regex_error <regex>
regex_match <regex>
regex_replace <regex>
regex_search <regex>
remove_pointer <type_traits>
remove_reference <type_traits>
replace <algorithm>
replace_copy <algorithm>
reverse_iterator <iterator>
right <iostream>
runtime_error <stdexcept>
S
scientific <iostream>
set <set>
set_difference <algorithm>
set_intersection <algorithm>
set_union <algorithm>
setfill <iomanip>
setprecision <iomanip>
setw <iomanip>
shared_ptr <memory>
showbase <iostream>
showpoint <iostream>
size_t <cstddef>
skipws <iostream>
smatch <regex>
sort <algorithm>
sqrt <cmath>
sregex_iterator <regex>
ssub_match <regex>
stable_sort <algorithm>
stack <stack>
stoi <string>
strcmp <cstring>
strcpy <cstring>
string <string>
stringstream <sstream>
strlen <cstring>
strncpy <cstring>
strtod <string>
swap <utility>
T
terminate <exception>
time <ctime>
tolower <cctype>
toupper <cctype>
transform <algorithm>
tuple <tuple>
tuple_element <tuple>
tuple_size <tuple>
type_info <typeinfo>
U
unexpected <exception>
uniform_int_distribution <random>
uniform_real_distribution <random>
uninitialized_copy <memory>
uninitialized_fill <memory>
unique <algorithm>
unique_copy <algorithm>
unique_ptr <memory>
unitbuf <iostream>
unordered_map <unordered_map>
unordered_multimap <unordered_map>
unordered_multiset <unordered_set>
unordered_set <unordered_set>
upper_bound <algorithm>
uppercase <iostream>
V
vector <vector>
W
weak_ptr <memory>
在泛型编程中我们接触到了标准库中的算法,指示了解了算法的特性,并没有对其接口深入了解,下面是常见算法的使用方式及其接口
1、beg和end表示元素范围的迭代器,算法对一个由beg和end表示的序列进行操作
2、beg2,end2是表示第二个输入序列开始和末尾位置的迭代器如果没有end2则表示第二个序列和第一个序列长度相同。beg和beg2的类型可以不匹配,但需要保证对两个序列中的元素都可以执行特定操作或调用给定的可调用对象。
3、dest表示目的序列的迭代器。对于给定输入序列,算法需要生成多少元素,目的序列必须保证能保存相同多的元素。
4、unaryPred和binaryPred是一元和二元谓词,分别接收一个和两个参数,都是来自输入序列的元素,两个谓词都可以返回可作用条件的类型
5、comp是一个二元谓词,满足关联容器对关键字虚的要求
6、unaryOp和binaryOp是可调用对象,可分别适用来自输入序列的一个和两个实参来调用
每个算法都提供两个重载,一个版本适用相等运算符比较,第二版本适用提供的unaryPred和binaryPred比较元素
对于序列中的元素进行排序,排序和划分算法都提供了多种策略,每个排序和划分算法都提供了稳定和不稳定的版本