template<class T = t::uint32>
class elm::Flags< T >
@macro UNUSED Avoid "unused variable" warning when put after the identifier of the variable. Mainly useful when a for(auto x: ...) is used. @macro ELM_UNUSED See UNUSED.
Small class to manage flags of bit in a safe way.
The user has to assign an index to each flag bit and they are stored in this class as an integer of type type T. Then, they may be read, set or cleared safely with function of Flags.
Operator (index) and [index] can be used as shortcuts to Flags::bit().
A common use of this class with 3 flags, RED, GREEN, BLUE could be:
Flags<> f;
f.set(RED);
f.clear(GREEN);
if(f(RED))
ANSICode GREEN
< ANSI code for red text
Definition: ansi.h:49
ANSICode RED
< ANSI code for black text
Definition: ansi.h:48
ANSICode BLUE
< ANSI code for yellow text
Definition: ansi.h:51
- Parameters
-
| T | Integer type to store the flag bits (default o t::uint32). |