• 【STL】各容器成员对比表


     

    Sequence containers

    Associative containers

     

    Headers

    <vector>

    <deque>

    <list>

    <set>

     

    <bitset>

    Members

    complex

    vector

    deque

    list

    set

    multiset

    map

    multimap

    bitset

     

    constructor

    *

    constructor

    constructor

    constructor

    constructor

    constructor

    constructor

    constructor

    constructor

    destructor

    O(n)

    destructor

    destructor

    destructor

    destructor

    destructor

    destructor

    destructor

     

    operator=

    O(n)

    operator=

    operator=

    operator=

    operator=

    operator=

    operator=

    operator=

    operators

    iterators

    begin

    O(1)

    begin

    begin

    begin

    begin

    begin

    begin

    begin

     

    end

    O(1)

    end

    end

    end

    end

    end

    end

    end

     

    rbegin

    O(1)

    rbegin

    rbegin

    rbegin

    rbegin

    rbegin

    rbegin

    rbegin

     

    rend

    O(1)

    rend

    rend

    rend

    rend

    rend

    rend

    rend

     

    capacity

    size

    *

    size

    size

    size

    size

    size

    size

    size

    size

    max_size

    *

    max_size

    max_size

    max_size

    max_size

    max_size

    max_size

    max_size

     

    empty

    O(1)

    empty

    empty

    empty

    empty

    empty

    empty

    empty

     

    resize

    O(n)

    resize

    resize

    resize

     

     

     

     

     

    element access

    front

    O(1)

    front

    front

    front

     

     

     

     

     

    back

    O(1)

    back

    back

    back

     

     

     

     

     

    operator[]

    *

    operator[]

    operator[]

     

     

     

    operator[]

     

    operator[]

    at

    O(1)

    at

    at

     

     

     

     

     

     

    modifiers

    assign

    O(n)

    assign

    assign

    assign

     

     

     

     

     

    insert

    *

    insert

    insert

    insert

    insert

    insert

    insert

    insert

     

    erase

    *

    erase

    erase

    erase

    erase

    erase

    erase

    erase

     

    swap

    O(1)

    swap

    swap

    swap

    swap

    swap

    swap

    swap

     

    clear

    O(n)

    clear

    clear

    clear

    clear

    clear

    clear

    clear

     

    push_front

    O(1)

     

    push_front

    push_front

     

     

     

     

     

    pop_front

    O(1)

     

    pop_front

    pop_front

     

     

     

     

     

    push_back

    O(1)

    push_back

    push_back

    push_back

     

     

     

     

     

    pop_back

    O(1)

    pop_back

    pop_back

    pop_back

     

     

     

     

     

    observers

    key_comp

    O(1)

     

     

     

    key_comp

    key_comp

    key_comp

    key_comp

     

    value_comp

    O(1)

     

     

     

    value_comp

    value_comp

    value_comp

    value_comp

     

    operations

    find

    O(log n)

     

     

     

    find

    find

    find

    find

     

    count

    O(log n)

     

     

     

    count

    count

    count

    count

    count

    lower_bound

    O(log n)

     

     

     

    lower_bound

    lower_bound

    lower_bound

    lower_bound

     

    upper_bound

    O(log n)

     

     

     

    upper_bound

    upper_bound

    upper_bound

    upper_bound

     

    equal_range

    O(log n)

     

     

     

    equal_range

    equal_range

    equal_range

    equal_range

     

    unique members

     

    capacity 
    reserve

     

    splice
    remove
    remove_if
    unique
    merge
    sort 
    reverse

     

     

     

     

    set
    reset
    flip 
    to_ulong
    to_string 
    test 
    anynone


    摘自:http://www.cplusplus.com

    本文地址:http://www.cnblogs.com/fangyukuan/archive/2010/09/21/1832675.html

     

     

     

     


  • 相关阅读:
    一个、说到所有的扩展指标
    时序图、流程图
    流程图总结
    UML活动图与流程图的区别
    类图与对象图
    app的描述-软件的描述
    UML的目标
    软件建模的用途
    Android中如何使用Intent在Activity之间传递对象[使用Serializable或者Parcelable]
    Serializable 和 Parcelable 区别
  • 原文地址:https://www.cnblogs.com/fangyukuan/p/1832675.html
Copyright © 2020-2023  润新知