vendredi 26 mars 2021

Using std::iota to fill an alphabet vector

In this code I'm filling the vector alpha with letters from 'a' to 'z':

std::vector<char> alpha(26);
std::iota(alpha.begin(), alpha.end(), 'a');

I'm assuming this will not work with all character encodings, can anyone confirm? Or deny?

Aucun commentaire:

Enregistrer un commentaire