#include <vector>
using namespace std;
void f(const vector<int>&) {}
void f(vector<int>&&) {}
int main()
{
while (true)
{
vector<int> coll;
//
// coll is dying, so,
// "f(coll)" will call "f(const vector<int>&)" or
// "f(vector<int>&&)" as per C++11?
//
f(coll);
}
}
In the code above, coll
is dying; so, f(coll)
will call f(const vector<int>&)
or f(vector<int>&&)
as per C++11?
Aucun commentaire:
Enregistrer un commentaire