File: add_enum_bitwise_operators.cpp

package info (click to toggle)
seqan3 3.0.2%2Bds-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,052 kB
  • sloc: cpp: 144,641; makefile: 1,288; ansic: 294; sh: 228; xml: 217; javascript: 50; python: 27; php: 25
file content (21 lines) | stat: -rw-r--r-- 346 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <seqan3/core/add_enum_bitwise_operators.hpp>

enum class my_enum
{
    VAL1 = 1,
    VAL2 = 2,
    COMB = 3
};

template <>
constexpr bool seqan3::add_enum_bitwise_operators<my_enum> = true;

int main()
{
    using seqan3::operator|;
    
    my_enum e = my_enum::VAL1;
    my_enum e2 = e | my_enum::VAL2;

    // e2 == my_enum::COMB;
}