• 第20章 接口手册【C++】


    第20章 接口手册

    标准库名字和头文件

    A

    abort    <cstdlib>
    accumulate    <numeric>
    allocator    <memory>
    array    <array>
    auto_ptr    <memory>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    C

    cerr    <iostream>
    cin    <iostream>
    cmatch    <regex>
    copy    <algorithm>
    count    <algorithm>
    count_if    <algorithm>
    cout    <iostream>
    cref    <functional>
    csub_match    <regex>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    D

    dec    <iostream>
    default_float_engine    <iostream>
    default_random_engine    <random>
    deque    <deque>
    domain_error    <stdexcept>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    E

    end    <iterator>
    endl    <iostream>
    ends    <iostream>
    equal_range    <algorithm>
    exception    <exception>
    
    • 1
    • 2
    • 3
    • 4
    • 5

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    G

    get    <tuple>
    getline    <string>
    greater    <functional>
    
    • 1
    • 2
    • 3

    H

    hash    <functional>
    hex    <iostream>
    hexfloat    <iostream>
    
    • 1
    • 2
    • 3

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    L

    left    <iostream>
    less    <functional>
    less_equal    <functional>
    list    <list>
    logic_error    <stdexcept>
    lower_bound    <algorithm>
    lround    <cmath>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12

    O

    oct    <iostream>
    ofstream    <fstream>
    ostream    <iostream>
    ostream_iterator    <iterator>
    ostringstream    <sstream>
    out_of_range    <stdexcept>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    P

    pair    <utility>
    partial_sort    <algorithm>
    placeholders    <functional>
    placeholders::_1    <functional>
    plus    <functional>
    priority_queue    <queue>
    ptrdiff_t    <cstddef>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    Q

    queue    <queue>
    
    • 1

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    T

    terminate    <exception>
    time    <ctime>
    tolower    <cctype>
    toupper    <cctype>
    transform    <algorithm>
    tuple    <tuple>
    tuple_element    <tuple>
    tuple_size    <tuple>
    type_info    <typeinfo>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15

    V

    vector    <vector>
    
    • 1

    W

    weak_ptr    <memory>
    
    • 1

    算法接口

    泛型编程中我们接触到了标准库中的算法,指示了解了算法的特性,并没有对其接口深入了解,下面是常见算法的使用方式及其接口

    1、beg和end表示元素范围的迭代器,算法对一个由beg和end表示的序列进行操作
    2、beg2,end2是表示第二个输入序列开始和末尾位置的迭代器如果没有end2则表示第二个序列和第一个序列长度相同。beg和beg2的类型可以不匹配,但需要保证对两个序列中的元素都可以执行特定操作或调用给定的可调用对象。
    3、dest表示目的序列的迭代器。对于给定输入序列,算法需要生成多少元素,目的序列必须保证能保存相同多的元素。
    4、unaryPred和binaryPred是一元和二元谓词,分别接收一个和两个参数,都是来自输入序列的元素,两个谓词都可以返回可作用条件的类型
    5、comp是一个二元谓词,满足关联容器对关键字虚的要求
    6、unaryOp和binaryOp是可调用对象,可分别适用来自输入序列的一个和两个实参来调用

    查找对象的算法

    每个算法都提供两个重载,一个版本适用相等运算符比较,第二版本适用提供的unaryPred和binaryPred比较元素

    简单查找算法 find、find_if、find_if_not、count、count_if、all_of、any_of、none_of

    在这里插入图片描述

    查找重复值的算法 adjacent_find、search_n

    在这里插入图片描述

    查找子序列的算法 search、find_first_of、find_end

    在这里插入图片描述

    for_each、mismatch、equal

    在这里插入图片描述

    二分操作算法lower_bound、upper_bound、equal_range、binary_search

    在这里插入图片描述

    只写不读的算法fill、fill_n、generate、generate_n

    在这里插入图片描述

    使用输入迭代器的写算法copy、copy_if、copy_n、move、transform、replace_copy、replace_copy_if、merge

    在这里插入图片描述

    使用向前迭代器的写算法iter_swap、swap_ranges、replace、replace_if

    在这里插入图片描述

    使用双向迭代器的写算法copy_backward、move_backward、inplace_merge

    在这里插入图片描述

    划分与排序算法

    对于序列中的元素进行排序,排序和划分算法都提供了多种策略,每个排序和划分算法都提供了稳定和不稳定的版本

    划分算法is_partitioned、partition_copy、partition_point、stable_partition、partition

    在这里插入图片描述

    排序算法sort、stable_sort、is_sorted、is_sorted_until、partial_sort、partial_sort_copy、nth_element

    在这里插入图片描述

    使用前向迭代器的重排算法remove、remove_if、remove_copy、remove_copy_if、unique、unique_copy、rotate、rotate_copy

    在这里插入图片描述

    使用双向迭代器的重排算法reverse、reverse_copy

    在这里插入图片描述

    使用随机访问迭代器的重排算法random_shuffle、random_shuffle、shuffle

    在这里插入图片描述

    排列算法is_permutation、next_permutation、prev_permutation

    在这里插入图片描述

    有序序列的集合算法includes、set_union、set_intersection、set_difference、set_symmetric_difference

    在这里插入图片描述

    最小值和最大值min、max、minmax、min_element、max_element、minmax_element

    在这里插入图片描述

    字典序比较lexicographical_compare

    在这里插入图片描述

    数值算法accumulate、inner_product、partial_sum、adjacent_difference、iota

    在这里插入图片描述

    随机数分布

    在这里插入图片描述

    均匀分布uniform_int_distribution、uniform_real_distribution

    在这里插入图片描述

    伯努利分布bernoulli_distribution、geometric_distribution、negative_binomial_distribution

    在这里插入图片描述

    泊松分布poisson_distribution、exponential_distribution、gamma_distribution、weibull_distribution、extreme_value_distribution

    在这里插入图片描述

    正态分布normal_distribution、lognormal_distribution、chi_squared_distribution、cauchy_distribution、fisher_f_distribution、student_t_distribution

    在这里插入图片描述

    抽样分布discrete_distribution、piecewise_constant_distribution、piecewise_linear_distribution

    在这里插入图片描述

    随机数引擎default_random_engine、linear_congruential_engine、mersenne_twister_engine、subtract_with_carry_engine、discard_block_engine、independent_bits_engine、shuffle_order_engin

    在这里插入图片描述

  • 相关阅读:
    c# 学习教程
    文献阅读(207)FPGA HBM
    AB试验(二)统计基础
    ISO质量认证范围和审核范围的简要解说
    Xcode中App图标和APP名称的修改
    分布式文件系统
    数据结构——栈和队列互相实现
    web:[极客大挑战 2019]Http
    【附证明】用ArcGIS中Band Collection Statistics做相关性分析可能存在错误
    leetcode 周赛(406)全AC留念
  • 原文地址:https://blog.csdn.net/qq_45812941/article/details/126258366