I have always thought that auto
in C++11 is a placeholder for the actual data type, but it appears not so in the following:
tuple<int, int> permute(int a, int b){return {b,a};}
int main(){
auto [x,y] = permute(2,5);
cout<<x<<","<<y<<endl;
tuple<int, int> {x,y} = permute(2,5);
cout<<x<<","<<y<<endl;
return 0;
}
Why auto
requires [ , ]
while a tuple requires curly brackets?