Can you spot the bug?
Find the Bug
by Andrzej Krzemieński
From the article:
Today, let's take a short test. Find what is likely to be a bug in the following code and suggest how to fix it.
void Catalogue::populate(vector<string> const& names) { vec_.clear(); vec_.resize(names.size()); for (size_t i = 0; i < names.size(); ++i) vec_[i] = make_unique<Entry>(names[i]); }
Add a Comment
Comments are closed.