There are plenty of answers with std::vector
, but what about std::unordered_set
?
My real question (closely related) is this; is it efficient to reuse the same unordered set by clearing it before each use, if I reserve what I know to be a reasonable size beforehand?