XII Release 0.1.0
Loading...
Searching...
No Matches
xiiIterateBitIndices< DataType, ReturnType > Struct Template Reference

Helper class to iterate over the bit indices of an integer. The class can iterate over the bits of any unsigned integer type that is equal to or smaller than xiiUInt64. More...

#include <IterateBits.h>

Inheritance diagram for xiiIterateBitIndices< DataType, ReturnType >:
[legend]

Public Member Functions

 xiiIterateBitIndices (DataType data)
 
- Public Member Functions inherited from xiiIterateBits< DataType, true, DataType >
 xiiIterateBits (DataType data)
 
xiiBitIterator< DataType, ReturnsIndex, DataType > begin () const
 
xiiBitIterator< DataType, ReturnsIndex, DataType > end () const
 

Additional Inherited Members

- Public Attributes inherited from xiiIterateBits< DataType, true, DataType >
DataType m_Data
 

Detailed Description

template<typename DataType, typename ReturnType = DataType>
struct xiiIterateBitIndices< DataType, ReturnType >

Helper class to iterate over the bit indices of an integer. The class can iterate over the bits of any unsigned integer type that is equal to or smaller than xiiUInt64.

xiiUInt64 bits = 0b1101;
for (auto bit : xiiIterateBitIndices(bits))
{
xiiLog::Info("{}", bit); // Outputs 0, 2, 3
}
static void Info(xiiLogInterface *pInterface, const xiiFormatString &string)
Status information that is important.
Definition Log.cpp:390
Template Parameters
DataTypeThe type of data that is being iterated over.
ReturnTypeReturned value type of the iterator. Defaults to same as DataType.

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