list、deque 到 vector 的转化

 

int main()
{
    deque<int> b = {1,2,3};
    list<int> c = {4,5,6};
    vector<int> a1(vector<int>{b.begin(),b.end()});
    vector<int> a2(vector<int>{c.begin(),c.end()});
    for(int i : a1)
    cout << i << ' ';
    cout << endl;
    for(int i : a2)
    cout << i << ' ';
}

 

posted @ 2021-01-06 20:36  zeroPatrick  阅读(2124)  评论(0编辑  收藏  举报