[libc-commits] [PATCH] D132254: [libc] Add a span facility

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Aug 19 14:27:14 PDT 2022


sivachandra added inline comments.


================
Comment at: libc/src/__support/CPP/span.h:82
+private:
+  constexpr size_type count_to_size(size_type offset, size_type count) const {
+    if (count == dynamic_extent) {
----------------
gchatelet wrote:
> sivachandra wrote:
> > gchatelet wrote:
> > > tschuett wrote:
> > > > Nit: snake case?
> > > > Nit:snake case?
> > > 
> > > Did you meant camelCase for `dynamic_extent`?
> > I think `s/countToSize/count_to_size/` 
> It was `count_to_size` (snake case) originally and I thought @tschuett asked me to go to camelCase. Then I figured out that the modifications I made to the file probably messed out with the lines on which the comment was attached (Phabricator... sigh). I inferred that it was probably `dynamic_extent` that was the culprit rather than `count_to_size`. But now I'm confused😅
I am also confused. Normal LLVM conventions do not apply in the libc directory, and the `cpp` namespace is even more special. So, I think `count_to_size` is correct. Likewise `Data` and `Size` are also not compliant. We can go with `span_data` and `span_size` to disambiguate with the methods `data` and `size`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132254/new/

https://reviews.llvm.org/D132254



More information about the libc-commits mailing list