vendredi 4 mai 2018

uniform initialization with two arguments

When I was practicing c++11, I tried the following conditions:

auto num1=(4, 5);
auto num2={4, 5};

As expected, num2 is initialized as vector of integers with two elements, while num1 is initialized as an integer with value 5.

Actually I thought num1 should not be compiled. What does (4, 5) mean here?

Aucun commentaire:

Enregistrer un commentaire