#include <vector>
using namespace std;
vector<int> f()
{
return{};
}
void g(vector<int>)
{}
void g(vector<int>&&)
{}
int main()
{
auto v1 = f();
auto&& v2 = f();
g(forward<vector<int>>(v1));
g(forward<vector<int>>(v2));
}
Does C++11 guarantee g(forward<vector<int>>(v1))
will call f(vector<int>)
and g(forward<vector<int>>(v2))
will call f(vector<int>&&)
?
Aucun commentaire:
Enregistrer un commentaire