]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Use C++20 constraints in <bit>
authorPatrick Palka <ppalka@redhat.com>
Fri, 15 Sep 2023 19:26:26 +0000 (15:26 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 15 Sep 2023 19:26:26 +0000 (15:26 -0400)
commitfd5a858eb5ef93c4ac7b0399b67d46805d2dabec
tree98b5d4dcf8e1925e1706ac7b6a220136b6c11c09
parentb09193fb0686b70ca26b7fa87f9d258503d63837
libstdc++: Use C++20 constraints in <bit>

Using a type-constraint instead of enable_if_t in the return types of
these functions greatly reduces the size of their mangled names.  And by
now it's probably safe to assume recent compilers have sufficient C++20
concepts support to handle such constraints.

libstdc++-v3/ChangeLog:

* include/std/bit: Include <concepts>.
(byteswap): Use a type-constraint instead of enable_if_t
inside the return type, and use std::integral.
(_If_is_unsigned_integer): Replace with ...
(__unsigned_integer): ... this.
(rotl): Use a type-constraint instead of enable_if_t inside
the return type.
(countl_zero): Likewise.
(countl_one): Likewise.
(countr_zero): Likewise.
(countr_one): Likewise.
(popcount): Likewise.
(has_single_bit): Likewise.
(bit_ceil): Likewise.
(bit_floor): Likewise.
(bit_width): Likewise.
libstdc++-v3/include/std/bit
This page took 0.059739 seconds and 5 git commands to generate.