2.10.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt.bit

Description

Bit operations.

This module provides safer bit operations, namely generating a shifted bit mask and testing a bit mask against a value.

Classes

class  fcppt::bit::mask< Type >
 A bit mask. More...
 

Typedefs

typedef unsigned fcppt::bit::shift_count
 The unsigned type representing a shift count. More...
 

Functions

template<typename Type , Type Mask>
constexpr fcppt::bit::mask< Type > fcppt::bit::mask_c () noexcept
 A bit mask from an integral constant. More...
 
template<typename Type >
constexpr fcppt::bit::mask< Type > fcppt::bit::shifted_mask (fcppt::bit::shift_count const _bits) noexcept
 A shifted mask. More...
 
template<typename Type , fcppt::bit::shift_count Bits>
constexpr fcppt::bit::mask< Type > fcppt::bit::shifted_mask_c () noexcept
 A constant shifted mask. More...
 
template<typename Type >
bool fcppt::bit::test (Type const _value, fcppt::bit::mask< Type > const _mask) noexcept
 Tests a value against a bit mask. More...
 

Typedef Documentation

◆ shift_count

typedef unsigned fcppt::bit::shift_count

The unsigned type representing a shift count.

Function Documentation

◆ mask_c()

template<typename Type , Type Mask>
constexpr fcppt::bit::mask< Type> fcppt::bit::mask_c ( )
inlinenoexcept

A bit mask from an integral constant.

◆ shifted_mask()

template<typename Type >
constexpr fcppt::bit::mask< Type> fcppt::bit::shifted_mask ( fcppt::bit::shift_count const  _bits)
inlinenoexcept

A shifted mask.

◆ shifted_mask_c()

template<typename Type , fcppt::bit::shift_count Bits>
constexpr fcppt::bit::mask< Type> fcppt::bit::shifted_mask_c ( )
inlinenoexcept

A constant shifted mask.

◆ test()

template<typename Type >
bool fcppt::bit::test ( Type const  _value,
fcppt::bit::mask< Type > const  _mask 
)
inlinenoexcept

Tests a value against a bit mask.