相关疑难解决方法(0)

快速方法将std :: list的指针转换为std :: list of value

我有一个std::list<obj*>,obj我的班级在哪里:

std::list<obj*> list_of_ptr;
list_of_ptr.push_back(new obj());
Run Code Online (Sandbox Code Playgroud)

我想将此列表转换为等效std::list<obj>,之后我不再需要了list_of_ptr.

做这项工作的最快方法是什么?

c++ containers stl

3
推荐指数
1
解决办法
735
查看次数

标签 统计

c++ ×1

containers ×1

stl ×1