Skip to content

Commit ea632e3

Browse files
committed
add noexcept for Flags operations
1 parent 20653dc commit ea632e3

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

include/gf2/core/Flags.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,72 +18,72 @@ namespace gf {
1818

1919
Flags() = default;
2020

21-
constexpr Flags(NoneType /* unused */)
21+
constexpr Flags(NoneType /* unused */) noexcept
2222
: m_data(0)
2323
{
2424
}
2525

26-
constexpr Flags(AllType /* unused */)
26+
constexpr Flags(AllType /* unused */) noexcept
2727
: m_data(0)
2828
{
2929
m_data = ~m_data;
3030
}
3131

32-
constexpr Flags(E e)
32+
constexpr Flags(E e) noexcept
3333
: m_data(static_cast<Type>(e))
3434
{
3535
}
3636

37-
constexpr Flags operator~() const
37+
constexpr Flags operator~() const noexcept
3838
{
3939
return Flags(~m_data);
4040
}
4141

42-
constexpr Flags operator|(Flags flags) const
42+
constexpr Flags operator|(Flags flags) const noexcept
4343
{
4444
return Flags(m_data | flags.m_data);
4545
}
4646

47-
Flags& operator|=(Flags flags)
47+
constexpr Flags& operator|=(Flags flags) noexcept
4848
{
4949
m_data |= flags.m_data;
5050
return *this;
5151
}
5252

53-
constexpr Flags operator&(Flags flags) const
53+
constexpr Flags operator&(Flags flags) const noexcept
5454
{
5555
return Flags(m_data & flags.m_data);
5656
}
5757

58-
Flags& operator&=(Flags flags)
58+
constexpr Flags& operator&=(Flags flags) noexcept
5959
{
6060
m_data &= flags.m_data;
6161
return *this;
6262
}
6363

64-
constexpr operator bool() const
64+
constexpr operator bool() const noexcept
6565
{
6666
return m_data != 0;
6767
}
6868

69-
constexpr bool test(E flag) const
69+
constexpr bool test(E flag) const noexcept
7070
{
7171
return (m_data & static_cast<Type>(flag)) != 0;
7272
}
7373

74-
void set(E flag)
74+
constexpr void set(E flag) noexcept
7575
{
7676
m_data |= static_cast<Type>(flag);
7777
}
7878

79-
void reset(E flag)
79+
constexpr void reset(E flag) noexcept
8080
{
8181
m_data &= ~static_cast<Type>(flag);
8282
}
8383

8484
using Type = std::underlying_type_t<E>;
8585

86-
constexpr Type value() const
86+
constexpr Type value() const noexcept
8787
{
8888
return m_data;
8989
}

0 commit comments

Comments
 (0)