Repository Details
Shared by
HelloGitHub Rating
0 ratings
用 C++11 实现的小型 STL(容器库+算法库)
Past 7 days Received -1 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周二 | 12,471 | — |
| 周三 | 12,470 | -1 |
| 周四 | 12,471 | +1 |
| 周五 | 12,470 | -1 |
| 周六 | 12,469 | -1 |
| 周日 | 12,469 | 0 |
| 周一 | 12,470 | +1 |
12.5k
Stars
Yes
Chinese
C++
Language
No
Active
10
Contributors
70
Issues
No
Organization
None
Latest
3k
Forks
None
License
用 C++11 实现的小型 STL(容器库+算法库)。代码结构清晰规范、包含中文文档与注释,并且自带一个简单的测试框架,适合新手学习与参考。示例代码如下:
```c++
// 在尾部插入元素
template <class T>
void vector<T>::push_back(const value_type& value)
{
if (end_ != cap_)
{
data_allocator::construct(mystl::address_of(*end_), value);
++end_;
}
else
{
reallocate_insert(end_, value);
}
}
```
Included in:
Vol.27
Comments
Rating:
No comments yet