lundi 22 mai 2017

returning std::vector. C++11 [duplicate]

This question already has an answer here:

std::vector<int> f1(){
    std::vector<int> v;
    return v;
}

std::vector<int>&& f2(){
    std::vector<int> v;
    return std::move(v);
}

How are they different? Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire