Closed jgopel closed 2 years ago
We already have this in Boost.Core
See https://github.com/boostorg/core/blob/develop/include/boost/core/bit.hpp
And https://www.boost.org/doc/libs/1_79_0/libs/core/doc/html/core/bit.html
We don't need a duplicate in Boost.Algorithm.
On May 5, 2022, at 2:51 PM, Glen Fernandes @.***> wrote:
We don't need a duplicate in Boost.Algorithm.
How do you feel about a PR adding constexpr, etc into the bit routines in Boost.core?
Any improvements to the functionality in Core are always good.
On a related note, it seemed like a few C++Now's ago, everyone was excited about a future Boost that didn't replicate functionality available in the C++ standard library. Has that changed, or does the sentiment not apply to C++20 and above?
constexpr
when using non-constexpr intrinsics isn't possible without std::is_constant_evaluated
, which is C++20. There's an issue already about this (https://github.com/boostorg/core/issues/109) and I'll probably end up adding separately named functions when constexpr
is required. (The existing functions are best-effort constexpr, which doesn't allow their portable use in constant expressions.)
As part of C++Now's Library in a Week effort.
Thanks to @fpikus for the help with this!