dimanche 4 janvier 2015

Why I can not use variable assigned using "initializer_list" as "normal" variable?


code:



void stovr(int a){}
int main() {

auto v {5}; // v is std::initializer_list<int>
stovr(v); // cannot convert 'std::initializer_list<int>' to 'int'

}



  • Why there is not implicit conversation?


Aucun commentaire:

Enregistrer un commentaire