samedi 17 décembre 2022

Why is there no conversion from int to vector

Regarding

vector<double> v2 = 9; //error: no conversion from int to vector

, is there no conversion from

int

to

vector<double>

because

std::vector<double>(int)

is explicit?

Would it have been possible to have had a type conversion of type floating-integral conversion in the case of it not having been declared explicit?

Aucun commentaire:

Enregistrer un commentaire