Re:We used C++20 to eliminate a class of runtime bugs
by rixed on Friday January 14, 2022 @05:39PM
(#29941499)
Easy because since the bite I'm adding some comments after those initialisations where I really intend to call a given constructor.
Three instances I could grep immediately, all from the same file:
std::vector<std::tuple<std::optional<qreal>, QString, QColor>>
values( // Not list-init
numValues, std::make_tuple(std::nullopt, QString(), QColor()));
(...)
std::vector<size_t> nextTupleIdx(numValues, 0); // Not list-init here!
std::vector<bool> done(numValues, false); // Not list-init here!
I do not doubt a single second that there are 36 ways to write this that are simpler, more efficient and more readable. Yet I would like to hear your suggestion.
Three instances I could grep immediately, all from the same file:
I do not doubt a single second that there are 36 ways to write this that are simpler, more efficient and more readable. Yet I would like to hear your suggestion.