aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/bit
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-31 21:22:58 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-31 21:22:58 +0000
commit5ffd83dbcc34f10e07f6d3e968ae6365869615f4 (patch)
tree0e9f5cf729dde39f949698fddef45a34e2bc7f44 /contrib/llvm-project/libcxx/include/bit
parent1799696096df87b52968b8996d00c91e0a5de8d9 (diff)
parentcfca06d7963fa0909f90483b42a6d7d194d01e08 (diff)
downloadsrc-5ffd83dbcc34f10e07f6d3e968ae6365869615f4.tar.gz
src-5ffd83dbcc34f10e07f6d3e968ae6365869615f4.zip
Notes
Diffstat (limited to 'contrib/llvm-project/libcxx/include/bit')
-rw-r--r--contrib/llvm-project/libcxx/include/bit9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/llvm-project/libcxx/include/bit b/contrib/llvm-project/libcxx/include/bit
index 6dc85b5d01fb..ae4605b19166 100644
--- a/contrib/llvm-project/libcxx/include/bit
+++ b/contrib/llvm-project/libcxx/include/bit
@@ -15,6 +15,7 @@
namespace std {
+ // [bit.pow.two], integral powers of 2
template <class T>
constexpr bool ispow2(T x) noexcept; // C++20
template <class T>
@@ -24,13 +25,13 @@ namespace std {
template <class T>
constexpr T log2p1(T x) noexcept; // C++20
- // 23.20.2, rotating
+ // [bit.rotate], rotating
template<class T>
constexpr T rotl(T x, unsigned int s) noexcept; // C++20
template<class T>
constexpr T rotr(T x, unsigned int s) noexcept; // C++20
- // 23.20.3, counting
+ // [bit.count], counting
template<class T>
constexpr int countl_zero(T x) noexcept; // C++20
template<class T>
@@ -42,7 +43,7 @@ namespace std {
template<class T>
constexpr int popcount(T x) noexcept; // C++20
- // 20.15.9, endian
+ // [bit.endian], endian
enum class endian {
little = see below, // C++20
big = see below, // C++20
@@ -350,7 +351,7 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
bool __ispow2(_Tp __t) _NOEXCEPT
{
static_assert(__bitop_unsigned_integer<_Tp>::value, "__ispow2 requires unsigned");
- return __t != 0 && (((__t & (__t - 1)) == 0));
+ return __t != 0 && (((__t & (__t - 1)) == 0));
}