提交 6ca8fa8c 编写于 作者: Z zhanglanqing

bug fix

上级 6587857d
......@@ -55,7 +55,7 @@ namespace TinySTL{
cb_iter<T, N, Alloc> operator +(const cb_iter<T, N, Alloc>& cit, std::ptrdiff_t i){
int real_i = i % (std::ptrdiff_t)N;//assume i >= 0
if (real_i < 0)
real_i += 5;
real_i += N;
cb_iter<T, N, Alloc> res = cit;
res.setIndex_(res.index_ + real_i);
res.setPtr_(res.ptr_ + res.index_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册