acme
Foundational cross-platform layer of the ca2 framework
Toggle main menu visibility
Loading...
Searching...
No Matches
enum_bitset.h
1
// Created by camilo on 2021-10-13 01:02 BRT <3ThomasBorregaardSorensen!!
2
#pragma once
3
4
5
template
<
typename
ENUM, ::i32 m_iBitCount >
6
class
enum_bitset
7
{
8
public
:
9
10
11
::u64 m_array[((m_iBitCount - 1) >> 6) + 1];
12
13
14
void
set(ENUM e) { m_array[e >> 6] |= (1ull << (e & 63)); }
15
void
clear(ENUM e) { m_array[e >> 6] &= ~(1ull << (e & 63)); }
16
bool
is_set(ENUM e) {
return
m_array[e >> 6] & (1ull << (e & 63)); }
17
void
set(ENUM e,
bool
bSet) {
if
(bSet) set(e);
else
clear(e); }
18
19
20
};
21
22
23
enum_bitset
Definition
enum_bitset.h:7
prototype
prototype
enum_bitset.h
Generated by
1.17.0