[llvm] r200688 - Introduce SmallPtrSetImpl<T *> which allows insert, erase, count, and

Chandler Carruth chandlerc at gmail.com
Tue Feb 4 15:44:30 PST 2014


On Tue, Feb 4, 2014 at 3:33 PM, Justin Bogner <mail at justinbogner.com> wrote:

> Chandler Carruth <chandlerc at gmail.com> writes:
> > Introduce SmallPtrSetImpl<T *> which allows insert, erase, count, and
> > iteration. This alows the majority of operations to be performed without
> > encoding a specific small size. It follows the model of
> > SmallVectorImpl<T>.
>
> There's a lot to be said for following the existing practice, so feel
> free to ignore this, but SmallVectorImpl isn't really a very indicative
> name for how it's used in the first place. It's just ubiquitous enough
> that it isn't worth changing. Maybe a better name from the get-go for
> SmallPtrSetImpl would be worthwhile?
>
> On the other hand, it probably isn't worth bikeshedding about a perfect
> name for this.


I actually think a better name would be great, but I'd *much* rather
consistency here given how thoroughly the current naming pattern has
penetrated the codebases. For a sufficiently better name pattern I'd even
be willing to broach the subject of switching the existing names over so
that we can have the best of both worlds.

The annoying thing is picking a substantially more clear name. Any ideas? I
don't really have many.

We could be clever and have SmallFoo<T, N> inherit from SmallFoo<T> -- if
you pass the N you get the concrete derived type, if you don't, you get the
basic functionality without a specific size. That is sadly the best (and
worst!) idea I have....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140204/9188d1f0/attachment.html>


More information about the llvm-commits mailing list