]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/coroutine2/include/boost/coroutine2/detail/state.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / coroutine2 / include / boost / coroutine2 / detail / state.hpp
CommitLineData
7c673cae
FG
1
2// Copyright Oliver Kowalke 2014.
3// Distributed under the Boost Software License, Version 1.0.
4// (See accompanying file LICENSE_1_0.txt or copy at
5// http://www.boost.org/LICENSE_1_0.txt)
6
7#ifndef BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP
8#define BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP
9
10#include <exception>
11
12#include <boost/assert.hpp>
13#include <boost/config.hpp>
14
15#include <boost/coroutine2/detail/config.hpp>
16
17#ifdef BOOST_HAS_ABI_HEADERS
18# include BOOST_ABI_PREFIX
19#endif
20
21namespace boost {
22namespace coroutines2 {
23namespace detail {
24
25enum class state_t : unsigned int {
26 none = 0,
27 complete = 1 << 1,
28 unwind = 1 << 2,
29 destroy = 1 << 3
30};
31
32
33inline
34constexpr state_t
35operator&( state_t l, state_t r) {
36 return static_cast< state_t >(
37 static_cast< unsigned int >( l) & static_cast< unsigned int >( r) );
38}
39
40inline
41constexpr state_t
42operator|( state_t l, state_t r) {
43 return static_cast< state_t >(
44 static_cast< unsigned int >( l) | static_cast< unsigned int >( r) );
45}
46
47inline
48constexpr state_t
49operator^( state_t l, state_t r) {
50 return static_cast< state_t >(
51 static_cast< unsigned int >( l) ^ static_cast< unsigned int >( r) );
52}
53
54inline
55constexpr state_t
56operator~( state_t l) {
57 return static_cast< state_t >( ~static_cast< unsigned int >( l) );
58}
59
60inline
61state_t &
62operator&=( state_t & l, state_t r) {
63 l = l & r;
64 return l;
65}
66
67inline
68state_t &
69operator|=( state_t & l, state_t r) {
70 l = l | r;
71 return l;
72}
73
74inline
75state_t &
76operator^=( state_t & l, state_t r) {
77 l = l ^ r;
78 return l;
79}
80
81}}}
82
83#ifdef BOOST_HAS_ABI_HEADERS
84# include BOOST_ABI_SUFFIX
85#endif
86
87#endif // BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP