GH-48591: [C++] Remove some bit utils from bit_utils.h and replace them with C++ 20 built in functions#49298
Conversation
|
Thanks @Anakin100100 ! Let's let CI run before proceeding any further :-) |
|
@github-actions crossbow submit cran |
|
Revision: 93de06e Submitted crossbow builds: ursacomputing/crossbow @ actions-c818e09dc6
|
|
@pitrou Can you approve a workflow rerun? It should run fine this time |
|
@kou It seems the Ruby bindings are still built with C++17 instead of C++20, is that right? |
|
@github-actions crossbow submit cran |
|
@github-actions crossbow submit -g cpp |
|
@Anakin100100 Thanks for doing those proactive fixes! |
|
Revision: 70e9749 Submitted crossbow builds: ursacomputing/crossbow @ actions-0270f7bfd5
|
|
Revision: 70e9749 Submitted crossbow builds: ursacomputing/crossbow @ actions-8de87fedb7 |
Rationale for this change
Before C++ 20 there was no built in implementation for many common bit operations utilities included in the stdlib so they were implemented in bit_utils.h. Now that they are included in the stdlib they should be removed from bit_utils to decrease the amount of code that needs to be maintained as described in #48591
What changes are included in this PR?
IsPowerOf2, PopCount, CountLeadingZeros, CountTrailingZeros, NumRequiredBits are removed from bit_utils and replaced with their equivalents from bit.h i.e. has_single_bit, popcount, countl_zero, countr_zero and bit_width.
Are these changes tested?
No new code is introduced and the stdlib implementation maintains parity with the replaced functions so no new unit tests are necessary.
Are there any user-facing changes?
No