OGLplus  (0.59.0) a C++ wrapper for rendering APIs

Sequence of unsigned integer values with specified number bits. More...

#include <eagine/biteset.hpp>

Public Types

using size_type = span_size_t
 Alias for size type.
 
using difference_type = span_size_t
 Alias for difference type.
 
using value_type = T
 Alias for element value type.
 
using iterator = biteset_iterator< biteset >
 Alias for iterator type.
 
using const_iterator = biteset_iterator< const biteset >
 Alias for const iterator type.
 

Public Member Functions

constexpr biteset () noexcept=default
 Default constructor.
 
template<typename... P, typename = std::enable_if_t< (sizeof...(P) == N) && std::conjunction_v<std::true_type, std::is_convertible<P, T>...>>>
constexpr biteset (P... p) noexcept
 Construction from a pack of integer values.
 
constexpr auto size () const noexcept -> size_type
 Returns the number of elements in this biteset. More...
 
constexpr auto get (size_type i) const noexcept
 Returns the i-th element in this biteset. More...
 
void set (size_type i, T value) noexcept
 Sets the i-th element in this biteset. More...
 
auto begin () const noexcept -> const_iterator
 Returns an iterator to the start of the sequence.
 
auto end () const noexcept -> const_iterator
 Returns an iterator past the end of the sequence.
 
auto begin () noexcept -> iterator
 Returns a const iterator to the start of the sequence.
 
auto end () noexcept -> iterator
 Returns a const iterator past the end of the sequence.
 
constexpr auto operator[] (size_type i) const noexcept -> biteset_value_proxy< const biteset >
 Subscript operator.
 
constexpr auto operator[] (size_type i) noexcept -> biteset_value_proxy< biteset >
 Subscript operator.
 
constexpr auto bytes () const noexcept -> const byteset< store_size > &
 Converts this biteset into a byteset.
 

Static Public Member Functions

template<typename UIntT >
static constexpr auto from_value (UIntT init) noexcept
 Constructs a biteset from the specified values splitting bit groups of size=B.
 

Friends

constexpr friend auto operator== (const biteset &a, const biteset &b) noexcept
 Equality comparison.
 
constexpr friend auto operator!= (const biteset &a, const biteset &b) noexcept
 Non-equality comparison.
 
constexpr friend auto operator< (const biteset &a, const biteset &b) noexcept
 Less-than comparison.
 
constexpr friend auto operator<= (const biteset &a, const biteset &b) noexcept
 Less-equal comparison.
 
constexpr friend auto operator> (const biteset &a, const biteset &b) noexcept
 Greater-than comparison.
 
constexpr friend auto operator>= (const biteset &a, const biteset &b) noexcept
 Greater-equal comparison.
 

Detailed Description

template<std::size_t N, std::size_t B, typename T>
class eagine::biteset< N, B, T >

Sequence of unsigned integer values with specified number bits.

Template Parameters
Nthe size - count of elements - in the sequence.
Bthe number of bits in each element.
Tthe type representing a single element outside of the biteset.
See also
byteset

Member Function Documentation

◆ get()

template<std::size_t N, std::size_t B, typename T >
constexpr auto eagine::biteset< N, B, T >::get ( size_type  i) const
inlineconstexprnoexcept

Returns the i-th element in this biteset.

Precondition
i < size()

◆ set()

template<std::size_t N, std::size_t B, typename T >
void eagine::biteset< N, B, T >::set ( size_type  i,
value 
)
inlinenoexcept

Sets the i-th element in this biteset.

Precondition
i < size()

◆ size()

template<std::size_t N, std::size_t B, typename T >
constexpr auto eagine::biteset< N, B, T >::size ( ) const -> size_type
inlineconstexprnoexcept

Returns the number of elements in this biteset.

See also
get

The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).