Plasma Engine  2.0
Loading...
Searching...
No Matches
plIterateBitValues< DataType, ReturnType > Struct Template Reference

Helper class to iterate over the bit values 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 plIterateBitValues< DataType, ReturnType >:

Public Member Functions

 plIterateBitValues (DataType data)
 
- Public Member Functions inherited from plIterateBits< DataType, false, 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, false, DataType >
DataType m_Data
 

Detailed Description

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

Helper class to iterate over the bit values 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 : plIterateBitValues(bits))
{
plLog::Info("{}", bit); // Outputs 1, 4, 8
}
static void Info(plLogInterface *pInterface, const plFormatString &string)
Status information that is important.
Definition Log.cpp:407
Helper class to iterate over the bit values of an integer. The class can iterate over the bits of any...
Definition IterateBits.h:42
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: