[PATCH] D31802: Add methods to find the next *unset* bits in a bit vector

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 11:05:57 PDT 2017


dberlin added a comment.

In https://reviews.llvm.org/D31802#721254, @amccarth wrote:

> Not really in the scope of this change, but, since BitVector has these STL-like methods, 'twould be nice if there were a BitVector::npos analogous to std::basic_string::npos rather than having all the users of the class have to hardcode the magic value or make vague checks like `>= 0`.
>
> I realize that these methods are returning an `int` rather than a `size_type` like the corresponding methods on strings.  Still, magic sentinel values are magic sentinel values, and the usage would be more consistent.


Yes, it would be nice for bitvecrtor and sparsebitvector to be more stl like.


https://reviews.llvm.org/D31802





More information about the llvm-commits mailing list