[PATCH] D132407: [ADT] Add llvm::ctpop to <bit> helper wrapper

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 22 13:02:17 PDT 2022


Tyker added inline comments.


================
Comment at: llvm/include/llvm/ADT/bit.h:72-73
+template <typename T,
+          typename = std::enable_if_t<std::is_integral<T>::value>,
+          typename = std::enable_if_t<std::is_unsigned<T>::value>>
+inline int popcount(T Value) noexcept {
----------------
`std::is_unsigned` already implies `std::is_integral`
and it is preferable to use the *_v variants instead of adding the `::value`



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132407



More information about the llvm-commits mailing list