不需要释放的!迭代器类似于指针,但是高于指针的!
[quote=引用 11 楼 mougaidong 的回复:] [quote=引用 10 楼 dyw 的回复:] [quote=引用 6 楼 ri_aje 的回复:] 迭代器本身不需要,主楼 list 里面指针指向的资源倒是可能需要释放。
[quote=引用 10 楼 dyw 的回复:] [quote=引用 6 楼 ri_aje 的回复:] 迭代器本身不需要,主楼 list 里面指针指向的资源倒是可能需要释放。
[quote=引用 6 楼 ri_aje 的回复:] 迭代器本身不需要,主楼 list 里面指针指向的资源倒是可能需要释放。
迭代器本身不需要,主楼 list 里面指针指向的资源倒是可能需要释放。
std::list< UserRes* >::iterator pUserRes; 这种值语义的对象,函数退出时都会释放的(RAII) 这种则不行 std::list< UserRes* >::iterator* pUserRes = new std::list< UserRes* >::iterator();
64,637
社区成员
250,559
社区内容
加载中
试试用AI创作助手写篇文章吧