问题
使用vector记录了一个10item的集合;
类似下面这种调用
auto it = numbers[current_index];
log("show other vector item"+otherVector[0]);
然后服务器在走到这里就报:
wrong vector::_M_range_check
打印了numbers的个数和current_index的值;都没发现有问题;
原因
是这条打印的日志有问题,之前加这条日志是为了显示传入的值;在另外一个流程中otherVector是空的,这里日志就会异常;
log("show other vector item"+otherVector[0]);
总以为是numbers[current_index];
的问题,没想到是日志的问题。