C++ Logo

std-proposals

Advanced search

Re: [std-proposals] More C++ bit manipulation utilities

From: (wrong string) Åberg <haberg_1_at_[hidden]>
Date: Thu, 26 Jun 2025 15:16:29 +0200
> On 26 Jun 2025, at 13:02, Jan Schultke via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> I'm interested in how much appetite there would be for the following set of functions in <bit>:

You might check what they use in a program like Stockfish, which is written in C++. They have compile options for architectures with popcnt support, where it would seem that std::popcount could be used.

When implementing arbitrary-size multiprecision numbers, std::bitset is of no use because both arithmetic and dynamic size are required, though there is use of some <bit> functions like std::countl_zero, but also both bit and word shifts, which std::vector<bool> does not have, nor access to and control over the underlying word.

Received on 2025-06-26 13:19:40