Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of C++20 bit manipulation features #543

Closed
axic opened this issue Sep 22, 2020 · 4 comments · Fixed by #689
Closed

Make use of C++20 bit manipulation features #543

axic opened this issue Sep 22, 2020 · 4 comments · Fixed by #689
Assignees
Labels
good first issue Good for newcomers hacktoberfest Selected for Hacktoberfest

Comments

@axic
Copy link
Member

axic commented Sep 22, 2020

We are currently using compiler builtins:

  • __builtin_clz
  • __builtin_clzll
  • __builtin_ctz
  • __builtin_ctzll
  • __builtin_popcount
  • __builtin_popcountll

These can be replaced with the new C++20 features proposed (see https://en.cppreference.com/w/cpp/numeric).

For an idea how to write such a wrapper, check out lib/fizzy/cxx20/span.hpp.

@axic axic added good first issue Good for newcomers hacktoberfest Selected for Hacktoberfest labels Sep 22, 2020
@herobank110
Copy link
Contributor

Hello, I have been reading about c++20 features and would like to try solve this issue.

@chfast
Copy link
Collaborator

chfast commented Sep 26, 2020

Hi @herobank110,

you can start with a simple task as follows:

@chfast
Copy link
Collaborator

chfast commented Sep 30, 2020

Correction, start with something other than popcount as it is being done in #551.

@herobank110
Copy link
Contributor

I made an wrapper of countl_zero. Please can you check it? #570

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers hacktoberfest Selected for Hacktoberfest
Projects
None yet
3 participants