jeudi 1 septembre 2016

Does making an initializer_list const change anything?

std::initializer_list<int> FOO = {1, 2, 3};
const std::initializer_list<int> BAR = {1, 2, 3};

What are the differences between those two variables? From my understanding of std::initializer_list, access is const-only anyway. Does making the entire thing const actually change anything?

Aucun commentaire:

Enregistrer un commentaire