jeudi 7 juin 2018

square bracket and the pair type in C++

I read a piece of code from a book but I do not really understand the grammar,

const auto& [local_min, local_max] = minmax(A[i], A[i+1]);

where A is vector of int and local_min and local_max are int.

I know minmax returns a pair, but what does the square brackets do, i.e. [local_min, local_max]? I guess it is not for arrays here.

Thanks.

Aucun commentaire:

Enregistrer un commentaire