Skip to content

Instantly share code, notes, and snippets.

@MatheusFaria
MatheusFaria / bitmask.h
Created November 21, 2018 17:54
32 Bitmask helper
#include <iostream>
class Bitmask {
public:
Bitmask(uint32_t _=0u) : n(_) {}
inline uint32_t get(int i) const { return (n >> i) & 1; }
inline void set (int i) { n |= (1 << i); }
inline void reset(int i) { n &= ~(1 << i); }