[libcxx-commits] [PATCH] D129310: [libc++][doc] Documents the header __bits.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 10 07:52:24 PDT 2022


Mordante added inline comments.


================
Comment at: libcxx/docs/UsingLibcxx.rst:447-448
+
+Starting with C++20 the Standard header ``<bit>`` is available. This header
+contains all functions available in  ``<__bits>``` under a different name.
+
----------------
philnik wrote:
> Mordante wrote:
> > philnik wrote:
> > > Could you maybe add a TODO somewhere to update the function names to match the standard ones?
> > I'm not sure whether we want to update these names. On one hand it's nice to use the C++20 name on the other hand I like to use the intrinsic's name. But I have no strong preference in either direction.
> > @lidonne What's your preference?
> > 
> > I'm not going to add a TODO. If we want to use the C++20 names I'll do the renaming in a separate patch as a parent of this one and adjust this one to the new names.
> Normally we mirror the names of the standard ones. This makes a lot of sense IMO, since people are much more likely to be familiar with the standard names than with intrinsics. Personally I also find the names `countl_zero` and `countr_zero` a lot more intuitive than `ctz` and `clz`. Unless you already know that `ctz` is count trailing zeros you would never guess that.
I don't object, but let's agree on the rename before doing the work.
(In this case I think the Standard library names aren't great either ;-) countr looks like a typo of counter.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129310



More information about the libcxx-commits mailing list