百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
返回工具页/返回 Issues 列表
#173·MyTinySTL

basic_string.h 中的 compare(size_type pos1, size_type count1, const_pointer s) const 方法逻辑错误

作者: elsa-elsa-elsa创建于 2025年1月1日更新于 2025年1月1日

compare(size_type pos1, size_type count1, const_pointer s) const 方法中 return compare_cstr(buffer_, n1, s, n2); 中的第一个参数不正确,应该是 buffer_ + pos1,而不是 buffer_。类似的其他 compare 方法也是如此。

内容来源: Alinshans/MyTinySTL

查看 GitHub 原文在 GitHub 查看讨论