Plasma Engine  2.0
Loading...
Searching...
No Matches
plIterateBitIndices< 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 plUInt64. More...

#include <IterateBits.h>

Inheritance diagram for plIterateBitIndices< DataType, ReturnType >:

Public Member Functions

 plIterateBitIndices (DataType data)
 
- Public Member Functions inherited from plIterateBits< DataType, true, DataType >
 plIterateBits (DataType data)
 
plBitIterator< DataType, ReturnsIndex, DataType > begin () const
 
plBitIterator< DataType, ReturnsIndex, DataType > end () const
 

Additional Inherited Members

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

Detailed Description

template<typename DataType, typename ReturnType = DataType>
struct plIterateBitIndices< 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 plUInt64.

plUInt64 bits = 0b1101;
for (auto bit : plIterateBitIndices(bits))
{
plLog::Info("{}", bit); // Outputs 0, 2, 3
}
static void Info(plLogInterface *pInterface, const plFormatString &string)
Status information that is important.
Definition Log.cpp:407
Helper class to iterate over the bit indices of an integer. The class can iterate over the bits of an...
Definition IterateBits.h:62
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: