骏哥呵呵33 发表于 2023-7-21 15:50

C++ stl_vector 学习_基本功能模拟实现 模拟实现源码+ stl_vector源码 深拷贝原理...

本帖最后由 骏哥呵呵33 于 2023-7-22 12:23 编辑


C++ stl_vector 学习_基本功能模拟实现模拟实现源码+ stl_vector源码 深拷贝实现

修改:
2023年7月22日12点21分

加上命名空间


环境:VS2019


目前实现了以下基本功能,
Member functions
(constructor)      Construct vector (public member function )
(destructor)      Vector destructor (public member function )
operator=            Assign content (public member function )
Iterators:
begin               Return iterator to beginning (public member function )
end                  Return iterator to end (public member function )
cbegin            Return const_iterator to beginning (public member function )
cend                  Return const_iterator to end (public member function )
Capacity:
size                  Return size (public member function )
resize            Change size (public member function )
capacity            Return size of allocated storage capacity (public member function )
empty            Test whether vector is empty (public member function )
reserve             Request a change in capacity (public member function )

Element access:
operator[]                  Access element (public member function )

Modifiers:
push_back             Add element at the end (public member function )
pop_back          Delete last element (public member function )
insert            Insert elements (public member function )
erase            Erase elements (public member function )
swap             Swap content (public member function )
clear             Clear content (public member function )

Non-member function overloads
relational operators                  Relational operators for vector (function template )
swap





Mofecx 发表于 2023-7-21 16:03

感谢分享

迈克一 发表于 2023-7-21 16:28

可以看看邓俊辉的C++数据结构,实现的非常聪明

btood 发表于 2023-7-21 22:51

感谢大佬分享

骏哥呵呵33 发表于 2023-7-22 11:20

valkyries254 发表于 2023-7-22 00:50
大佬是打算从事C++语言这块的工作吗手动实现stl强

正在学习中:loveliness:
页: [1]
查看完整版本: C++ stl_vector 学习_基本功能模拟实现 模拟实现源码+ stl_vector源码 深拷贝原理...