template<std::size_t size>
Magnum::Math::BoolVector class

Vector storing boolean values.

Template parameters
size Bit count

Result of component-wise comparison from Vector. The boolean values are stored as bits in array of unsigned bytes, unused bits have undefined value which doesn't affect comparison or all() / none() / any() functions. See also Operations with matrices and vectors for brief introduction.

Public types

enum (anonymous): std::size_t { Size = size, DataSize = (size-1)/8+1 }

Constructors, destructors, conversion operators

BoolVector(ZeroInitT = ZeroInit) constexpr noexcept
Construct zero-filled boolean vector.
BoolVector(NoInitT) explicit noexcept
Construct without initializing the contents.
template<class ... T>
BoolVector(UnsignedByte first, T... next) constexpr noexcept
Construct boolean vector from segment values.
BoolVector(T value) explicit noexcept
Construct boolean vector with one value for all fields.
BoolVector(const BoolVector<size>&) noexcept defaulted constexpr
Copy constructor.
operator bool() const explicit
Boolean conversion.

Public functions

auto data() -> UnsignedByte*
Raw data.
auto data() const -> const UnsignedByte* constexpr
auto operator[](std::size_t i) const -> bool constexpr
Bit at given position.
auto set(std::size_t i, bool value) -> BoolVector<size>&
Set bit at given position.
auto operator==(const BoolVector<size>& other) const -> bool
Equality comparison.
auto operator!=(const BoolVector<size>& other) const -> bool
Non-equality comparison.
auto all() const -> bool
Whether all bits are set.
auto none() const -> bool
Whether no bits are set.
auto any() const -> bool
Whether any bit is set.
auto operator~() const -> BoolVector<size>
Bitwise inversion.
auto operator&=(const BoolVector<size>& other) -> BoolVector<size>&
Bitwise AND and assign.
auto operator&(const BoolVector<size>& other) const -> BoolVector<size>
Bitwise AND.
auto operator|=(const BoolVector<size>& other) -> BoolVector<size>&
Bitwise OR and assign.
auto operator|(const BoolVector<size>& other) const -> BoolVector<size>
Bitwise OR.
auto operator^=(const BoolVector<size>& other) -> BoolVector<size>&
Bitwise XOR and assign.
auto operator^(const BoolVector<size>& other) const -> BoolVector<size>
Bitwise XOR.

Enum documentation

template<std::size_t size>
enum Magnum::Math::BoolVector<size>::(anonymous): std::size_t

Enumerators
Size

Vector size

DataSize

Vector storage size

Function documentation

template<std::size_t size> template<class ... T>
Magnum::Math::BoolVector<size>::BoolVector(UnsignedByte first, T... next) constexpr noexcept

Construct boolean vector from segment values.

Parameters
first Value for first 8bit segment
next Values for next Bbit segments

template<std::size_t size>
Magnum::Math::BoolVector<size>::operator bool() const explicit

Boolean conversion.

Equivalent to all().

template<std::size_t size>
UnsignedByte* Magnum::Math::BoolVector<size>::data()

Raw data.

Returns Array of DataSize length

template<std::size_t size>
const UnsignedByte* Magnum::Math::BoolVector<size>::data() const constexpr

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

template<std::size_t size>
bool Magnum::Math::BoolVector<size>::all() const

Whether all bits are set.

template<std::size_t size>
bool Magnum::Math::BoolVector<size>::none() const

Whether no bits are set.

template<std::size_t size>
bool Magnum::Math::BoolVector<size>::any() const

Whether any bit is set.

template<std::size_t size>
BoolVector<size>& Magnum::Math::BoolVector<size>::operator&=(const BoolVector<size>& other)

Bitwise AND and assign.

The computation is done in-place.

template<std::size_t size>
BoolVector<size> Magnum::Math::BoolVector<size>::operator&(const BoolVector<size>& other) const

Bitwise AND.

template<std::size_t size>
BoolVector<size>& Magnum::Math::BoolVector<size>::operator|=(const BoolVector<size>& other)

Bitwise OR and assign.

The computation is done in-place.

template<std::size_t size>
BoolVector<size> Magnum::Math::BoolVector<size>::operator|(const BoolVector<size>& other) const

Bitwise OR.

template<std::size_t size>
BoolVector<size>& Magnum::Math::BoolVector<size>::operator^=(const BoolVector<size>& other)

Bitwise XOR and assign.

The computation is done in-place.

template<std::size_t size>
BoolVector<size> Magnum::Math::BoolVector<size>::operator^(const BoolVector<size>& other) const

Bitwise XOR.

template<std::size_t size> template<std::size_t size>
Corrade::Utility::Debug& operator<<(Corrade::Utility::Debug& debug, const BoolVector<size>& value)

Debug output operator.