Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
yield.hpp
Go to the documentation of this file.
1// Copyright 2003-2013 Christopher M. Kohlhoff
2// Copyright Oliver Kowalke, Nat Goodspeed 2015.
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
8#ifndef BOOST_FIBERS_ASIO_YIELD_HPP
9#define BOOST_FIBERS_ASIO_YIELD_HPP
10
11#include <boost/config.hpp>
12
13#ifdef BOOST_HAS_ABI_HEADERS
14# include BOOST_ABI_PREFIX
15#endif
16
17namespace boost {
18namespace fibers {
19namespace asio {
20
21//[fibers_asio_yield_t
22class yield_t {
23public:
24 yield_t() = default;
25
38 yield_t operator[]( boost::system::error_code & ec) const {
39 yield_t tmp;
40 tmp.ec_ = & ec;
41 return tmp;
42 }
43
44//private:
45 // ptr to bound error_code instance if any
46 boost::system::error_code * ec_{ nullptr };
47};
48//]
49
50//[fibers_asio_yield
51// canonical instance
52thread_local yield_t yield{};
53//]
54
55}}}
56
57#ifdef BOOST_HAS_ABI_HEADERS
58# include BOOST_ABI_SUFFIX
59#endif
60
61#include "detail/yield.hpp"
62
63#endif // BOOST_FIBERS_ASIO_YIELD_HPP
boost::system::error_code * ec_
Definition yield.hpp:46
yield_t operator[](boost::system::error_code &ec) const
Definition yield.hpp:38
thread_local yield_t yield
Definition yield.hpp:52