OGLplus  (0.59.0) a C++ wrapper for rendering APIs

bool_aggregate.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_BOOL_AGGREGATE_HPP
10 #define EAGINE_BOOL_AGGREGATE_HPP
11 
12 namespace eagine {
13 
16 class some_true {
17 public:
19  constexpr auto operator()(bool b = true) noexcept -> auto& {
20  _result |= b;
21  return *this;
22  }
23 
25  constexpr operator bool() const noexcept {
26  return _result;
27  }
28 
29 private:
30  bool _result{false};
31 };
32 
33 } // namespace eagine
34 
35 #endif // EAGINE_BOOL_AGGREGATE_HPP
Common code is placed in this namespace.
Definition: eagine.hpp:21
Class storing initially false value and logically or-ing other values.
Definition: bool_aggregate.hpp:16
constexpr auto operator()(bool b=true) noexcept -> auto &
Logically or-s the stored state with the specified argument.
Definition: bool_aggregate.hpp:19

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).