CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Created by Sharpneli
// Created by Sharpneli
// modified by Jerry Hobby to demonstrate some minor improvements.
#include <iostream>
#include <chrono>
#include <vector>
using namespace std;
class User
{
public:
enum Privilege {
IS_AUTH = 0b00000001,
IS_ADMIN = 0b00000010,
IS_MOD = 0b00000100
};
User(const char* uname, int privilege) : level_(bit_) {
level_ |= privilege;
}
inline bool isAuthenticated() const {
return level_ & IS_AUTH;
}
inline bool isMod() const {
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run