How to declare a vector of unique_ptr's as class data member?

后端 未结 5 1321
借酒劲吻你
借酒劲吻你 2021-02-20 11:26

I\'d like to have a vector of unique_ptr\'s as a member of a class I\'m making.

class Foo {
    [...]

private:
    vector> barList;
         


        
5条回答
  •  天涯浪人
    2021-02-20 11:56

    Often a std::move(iUniquePtr) is missing somewhere (e. g. when using push_back).

提交回复
热议问题