我试图通过一些复杂的计算来构造一个sregex_iterator,所以我编写了一个函数来完成这个任务并返回迭代器。但是,当我想增加返回的迭代器时,程序会崩溃,有时会抛出std::bad_alloc,有时不会..。can incr ..terminate called after throwing an instance of 'std</
当我试图将一个额外的字符串推到向量的中间时,我得到了terminate called after throwing an instance of 'std::bad_alloc'。我使用了g++ 4.8.2。
在size of str_vector 0: 1, size of str_vector 1: 1上使用g++ 5.2时,我甚至得到了错误向量大小的输出。当我使用索引(例如str_vector[0])访问向量