[PATCH] D46668: [STLExtras] Add a range-based distance()

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 10 11:18:19 PDT 2018


vsk added a comment.

In https://reviews.llvm.org/D46668#1093851, @craig.topper wrote:

> I sort of wonder if we should have a pred_size and succ_size helper.


One motivation for this might be that meaning of `distance(predecessors(b))` isn't obvious at first glance. Is that your concern?

If so, maybe it would be even simpler to name the new helper `size`. This would be more general than introducing pred_size/succ_size/etc, and might be easier to read overall. Wdyt?


https://reviews.llvm.org/D46668





More information about the llvm-commits mailing list