<div dir="ltr">In the typical case where you want a set of pointers,<br><br>If the number of elements is expected to be usually small, SmallPtrSet is recommended; this seems clear enough.<br><br>However, if the number of elements is not particularly likely to be small,<br><br>"DenseSet is a simple quadratically probed hash table. It excels at supporting
small values: it uses a single allocation to hold all of the pairs that are
currently inserted in the set. DenseSet is a great way to unique small values
that are not simple pointers (use <a class="" href="http://llvm.org/docs/ProgrammersManual.html#dss-smallptrset"><em>SmallPtrSet</em></a> for
pointers)."<br><br>The name plus the above paragraph from the documentation suggest DenseSet should be used for small integers that have a limited range of values, and SparseSet should be used for pointers (whose values are sparse within the space of all possible values).<br><br>However, looking at examples of usage, it seems to be the other way round; 'dense' vs 'sparse' refer not to the space of values but to the data structures used internally in the implementation, and actually SparseSet is intended for small integers with a limited range of values...<br><br>And the answer to the original question is that DenseSet should be used as the normal/default set type (for pointers, where there is no particular expectation about the number of elements and no other special requirements).<br><br>Is the above correct, or am I missing anything?<br></div>