~singpolyma/biboumi

ref: 40db183e3753486deaa43e950fff38579c5ced6f biboumi/src/utils/optional_bool.hpp -rw-r--r-- 329 bytes
40db183e — louiz’ Using OptionalBool, add RecordHistoryOptional col into IrcChannelOptions table 5 years ago
                                                                                
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
#pragma once

#include <string>

struct OptionalBool
{
  OptionalBool() = default;

  OptionalBool(bool value):
  is_set(true), value(value) {}

  void set_value(bool value)
  {
    this->is_set = true;
    this->value = value;
  }

  void unset()
  {
    this->is_set = false;
  }

  bool is_set{false};
  bool value{false};
};