mardi 4 février 2020

Why doesn't QTCreator warn me if an emplace_back is completely wrong?

Let's say I have this vector of pairs of numbers:

std::vector<std::pair<ulong, ulong>> uniquePairs;

If I do:

uniquePairs.emplace_back("literal garbage data");

It doesn't yell at me. Shouldn't something be screaming at me that this code is horribly, completely wrong? There are no warnings from the linter at all.

Of course, it fails when I go to actually compile with GCC.

Aucun commentaire:

Enregistrer un commentaire