ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
bits.hpp File Reference

Description:


This header file is part of the ALib C++ Library . It does not belong to an ALib Module and is included in any ALib Distribution .

© 2013-2024 A-Worx GmbH, Germany. Published under Boost Software License.

Definition in file bits.hpp.

#include "alib/lang/integers.hpp"
#include <intrin.h>
#include <iterator>
Include dependency graph for bits.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  alib
 
namespace  alib::lang
 

Macros

C/C++ Language And Linkage Macros

The macros listed here are supporting C++ compilation and linking control and language specific utilities.

#define bitsof(type)   static_cast<int>(sizeof(type) * 8)
 

Typedefs

using ShiftOpRHS = int
 

Functions

template<typename TIntegral >
constexpr int BitCount (TIntegral value)
 
template<typename T >
constexpr int bitsofval (const T &val)
 
template<typename TIntegral >
constexpr int CLZ (TIntegral value)
 
template<typename TIntegral >
constexpr int CLZ0 (TIntegral value)
 
template<typename TIntegral >
constexpr int CTZ (TIntegral value)
 
template<typename TIntegral >
constexpr int CTZ0 (TIntegral value)
 
template<typename TIntegral >
constexpr int Log2OfSize ()
 
template<typename TIntegral >
constexpr TIntegral LowerBits (ShiftOpRHS width, TIntegral value)
 
template<ShiftOpRHS TWidth, typename TIntegral >
constexpr TIntegral LowerBits (TIntegral value)
 
template<ShiftOpRHS TWidth, typename TIntegral >
constexpr TIntegral LowerMask ()
 
template<typename TIntegral >
constexpr TIntegral LowerMask (ShiftOpRHS width)
 
template<typename TIntegral >
constexpr int MSB (TIntegral value)
 
template<typename TIntegral >
constexpr int MSB0 (TIntegral value)
 
template<ShiftOpRHS TWidth, typename TIntegral >
constexpr TIntegral UpperMask ()
 
template<typename TIntegral >
constexpr TIntegral UpperMask (ShiftOpRHS width)