-----code----
vector<int&calc (){
vector<inttemp;
temp.push_back( 3);
return temp;
}
----code----
"temp" is a temporary variable, when returned, it's like return by
alias.
So is the code above legal?
vector<int&calc (){
vector<inttemp;
temp.push_back( 3);
return temp;
}
----code----
"temp" is a temporary variable, when returned, it's like return by
alias.
So is the code above legal?
Comment