• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // execution/detail/void_receiver.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef BOOST_ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
12 #define BOOST_ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/traits/set_done_member.hpp>
20 #include <boost/asio/traits/set_error_member.hpp>
21 #include <boost/asio/traits/set_value_member.hpp>
22 
23 #include <boost/asio/detail/push_options.hpp>
24 
25 namespace boost {
26 namespace asio {
27 namespace execution {
28 namespace detail {
29 
30 struct void_receiver
31 {
set_valueboost::asio::execution::detail::void_receiver32   void set_value() BOOST_ASIO_NOEXCEPT
33   {
34   }
35 
36   template <typename E>
set_errorboost::asio::execution::detail::void_receiver37   void set_error(BOOST_ASIO_MOVE_ARG(E)) BOOST_ASIO_NOEXCEPT
38   {
39   }
40 
set_doneboost::asio::execution::detail::void_receiver41   void set_done() BOOST_ASIO_NOEXCEPT
42   {
43   }
44 };
45 
46 } // namespace detail
47 } // namespace execution
48 namespace traits {
49 
50 #if !defined(BOOST_ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
51 
52 template <>
53 struct set_value_member<boost::asio::execution::detail::void_receiver, void()>
54 {
55   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
56   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
57   typedef void result_type;
58 };
59 
60 #endif // !defined(BOOST_ASIO_HAS_DEDUCED_SET_VALUE_MEMBER_TRAIT)
61 
62 #if !defined(BOOST_ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
63 
64 template <typename E>
65 struct set_error_member<boost::asio::execution::detail::void_receiver, E>
66 {
67   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
68   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
69   typedef void result_type;
70 };
71 
72 #endif // !defined(BOOST_ASIO_HAS_DEDUCED_SET_ERROR_MEMBER_TRAIT)
73 
74 #if !defined(BOOST_ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
75 
76 template <>
77 struct set_done_member<boost::asio::execution::detail::void_receiver>
78 {
79   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_valid = true);
80   BOOST_ASIO_STATIC_CONSTEXPR(bool, is_noexcept = true);
81   typedef void result_type;
82 };
83 
84 #endif // !defined(BOOST_ASIO_HAS_DEDUCED_SET_DONE_MEMBER_TRAIT)
85 
86 } // namespace traits
87 } // namespace asio
88 } // namespace boost
89 
90 #include <boost/asio/detail/pop_options.hpp>
91 
92 #endif // BOOST_ASIO_EXECUTION_DETAIL_VOID_RECEIVER_HPP
93