Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:34

0001 
0002 //          Copyright Oliver Kowalke 2014.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 //    (See accompanying file LICENSE_1_0.txt or copy at
0005 //          http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP
0008 #define BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP
0009 
0010 #include <exception>
0011 
0012 #include <boost/assert.hpp>
0013 #include <boost/config.hpp>
0014 
0015 #include <boost/coroutine2/detail/config.hpp>
0016 
0017 #ifdef BOOST_HAS_ABI_HEADERS
0018 #  include BOOST_ABI_PREFIX
0019 #endif
0020 
0021 namespace boost {
0022 namespace coroutines2 {
0023 namespace detail {
0024 
0025 enum class state_t : unsigned int {
0026     none       = 0,
0027     complete   = 1 << 1,
0028     unwind     = 1 << 2,
0029     destroy    = 1 << 3
0030 };
0031 
0032 
0033 inline
0034 constexpr state_t
0035 operator&( state_t l, state_t r) {
0036     return static_cast< state_t >(
0037             static_cast< unsigned int >( l) & static_cast< unsigned int >( r) );
0038 }
0039 
0040 inline
0041 constexpr state_t
0042 operator|( state_t l, state_t r) {
0043     return static_cast< state_t >(
0044             static_cast< unsigned int >( l) | static_cast< unsigned int >( r) );
0045 }
0046 
0047 inline
0048 constexpr state_t
0049 operator^( state_t l, state_t r) {
0050     return static_cast< state_t >(
0051             static_cast< unsigned int >( l) ^ static_cast< unsigned int >( r) );
0052 }
0053 
0054 inline
0055 constexpr state_t
0056 operator~( state_t l) {
0057     return static_cast< state_t >( ~static_cast< unsigned int >( l) );
0058 }
0059 
0060 inline
0061 state_t &
0062 operator&=( state_t & l, state_t r) {
0063     l = l & r;
0064     return l;
0065 }
0066 
0067 inline
0068 state_t &
0069 operator|=( state_t & l, state_t r) {
0070     l = l | r;
0071     return l;
0072 }
0073 
0074 inline
0075 state_t &
0076 operator^=( state_t & l, state_t r) {
0077     l = l ^ r;
0078     return l;
0079 }
0080 
0081 }}}
0082 
0083 #ifdef BOOST_HAS_ABI_HEADERS
0084 #  include BOOST_ABI_SUFFIX
0085 #endif
0086 
0087 #endif // BOOST_COROUTINES2_DETAIL_ASYMMETRIC_COROUTINE_HPP