我“写”了一个低效的STL子集

tinySTL

本人参考《STL源码剖析》“写”了一个低效的STL 子集。代码中有比较详细的注释,可作为阅读《STL源码剖析》的辅助材料。

本项目为本人的练习项目,所以暂时未提供测试,不能保证完全正确。请多多包涵。

至于怎么“低效”了,我后面会整理一些我已经能预见到会低效的实现。敬请期待。

源码

Github

已完成

  • 空间配置器
  • 普通迭代器
  • 反向迭代器
  • vector
  • list
  • deque
  • stack
  • queue
  • heap
  • priority_queue
  • rb_tree(实现来自GitHub
  • set
  • multiset
  • map
  • multimap
  • hashtable(其他 hash 函数参考here
  • unordered_set
  • unordered_map
  • unordered_multiset
  • unordered_multimap
  • type traits

    • integral_constant
    • true_type
    • false_type
    • is_same
    • is_integral
    • remove_reference
    • remove_reference_t
    • add_lvalue_reference
    • add_lvalue_reference_t
    • add_rvalue_reference
    • add_rvalue_reference_t
    • __type_traits
  • 算法

    • all_of
    • any_of
    • none_of
    • for_each
    • count
    • count_if
    • mismatch
    • find
    • find_if
    • find_if_not
    • find_end
    • find_first_of
    • adjacent_find
    • search
    • search_n
    • copy
    • copy_if
    • copy_n
    • copy_backward
    • move
    • move_backward
    • remove
    • remove_if
    • remove_copy
    • remove_copy_if
    • replace
    • replace_if
    • replace_copy
    • replace_copy_if
    • swap
    • swap_ranges
    • iter_swap
    • reverse
    • reverse_copy
    • rotate
    • rotate_copy
    • unique
    • unique_copy
    • is_partitioned
    • partition
    • partition_copy
    • max
    • max_element
    • min
    • min_element
    • equal
    • lexicographical_compare
    • move
  • functional

    • hash
    • plus
    • minus
    • multiplies
    • divides
    • modulus
    • negate
    • equal_to
    • not_equal_to
    • greater
    • less
    • greater_equal
    • less_equal
    • logical_and
    • logical_or
    • logical_not
    • bit_and
    • bit_or
    • bit_xor
    • identity
    • select1st
    • select2nd
  • utility

    • initializer_list
    • forward
    • move
    • pair
    • make_pair
  • numeric

    • iota
    • accumulate
    • inner_product
    • adjacent_difference
    • partial_sum
  • memory(简单实现)

    • shared_ptr
    • weak_ptr
    • unique_ptr
    • addressof
    • uninitialized_copy
    • uninitialized_copy_n
    • uninitialized_fill
    • uninitialized_fill_n
  • cstring

    • strcpy
    • strncpy
    • memcpy

TODO

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章