1 //
2 // detail/handler_type_requirements.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2019 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_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP
12 #define BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_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 
20 // Older versions of gcc have difficulty compiling the sizeof expressions where
21 // we test the handler type requirements. We'll disable checking of handler type
22 // requirements for those compilers, but otherwise enable it by default.
23 #if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
24 # if !defined(__GNUC__) || (__GNUC__ >= 4)
25 #  define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS 1
26 # endif // !defined(__GNUC__) || (__GNUC__ >= 4)
27 #endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
28 
29 // With C++0x we can use a combination of enhanced SFINAE and static_assert to
30 // generate better template error messages. As this technique is not yet widely
31 // portable, we'll only enable it for tested compilers.
32 #if !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
33 # if defined(__GNUC__)
34 #  if ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
35 #   if defined(__GXX_EXPERIMENTAL_CXX0X__)
36 #    define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
37 #   endif // defined(__GXX_EXPERIMENTAL_CXX0X__)
38 #  endif // ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)) || (__GNUC__ > 4)
39 # endif // defined(__GNUC__)
40 # if defined(BOOST_ASIO_MSVC)
41 #  if (_MSC_VER >= 1600)
42 #   define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
43 #  endif // (_MSC_VER >= 1600)
44 # endif // defined(BOOST_ASIO_MSVC)
45 # if defined(__clang__)
46 #  if __has_feature(__cxx_static_assert__)
47 #   define BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT 1
48 #  endif // __has_feature(cxx_static_assert)
49 # endif // defined(__clang__)
50 #endif // !defined(BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS)
51 
52 #if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
53 # include <boost/asio/async_result.hpp>
54 #endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
55 
56 namespace boost {
57 namespace asio {
58 namespace detail {
59 
60 #if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
61 
62 # if defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
63 
64 template <typename Handler>
65 auto zero_arg_copyable_handler_test(Handler h, void*)
66   -> decltype(
67     sizeof(Handler(static_cast<const Handler&>(h))),
68     ((h)()),
69     char(0));
70 
71 template <typename Handler>
72 char (&zero_arg_copyable_handler_test(Handler, ...))[2];
73 
74 template <typename Handler, typename Arg1>
75 auto one_arg_handler_test(Handler h, Arg1* a1)
76   -> decltype(
77     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
78     ((h)(*a1)),
79     char(0));
80 
81 template <typename Handler>
82 char (&one_arg_handler_test(Handler h, ...))[2];
83 
84 template <typename Handler, typename Arg1, typename Arg2>
85 auto two_arg_handler_test(Handler h, Arg1* a1, Arg2* a2)
86   -> decltype(
87     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
88     ((h)(*a1, *a2)),
89     char(0));
90 
91 template <typename Handler>
92 char (&two_arg_handler_test(Handler, ...))[2];
93 
94 template <typename Handler, typename Arg1, typename Arg2>
95 auto two_arg_move_handler_test(Handler h, Arg1* a1, Arg2* a2)
96   -> decltype(
97     sizeof(Handler(BOOST_ASIO_MOVE_CAST(Handler)(h))),
98     ((h)(*a1, BOOST_ASIO_MOVE_CAST(Arg2)(*a2))),
99     char(0));
100 
101 template <typename Handler>
102 char (&two_arg_move_handler_test(Handler, ...))[2];
103 
104 #  define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg) \
105      static_assert(expr, msg);
106 
107 # else // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
108 
109 #  define BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT(expr, msg)
110 
111 # endif // defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS_ASSERT)
112 
113 template <typename T> T& lvref();
114 template <typename T> T& lvref(T);
115 template <typename T> const T& clvref();
116 template <typename T> const T& clvref(T);
117 #if defined(BOOST_ASIO_HAS_MOVE)
118 template <typename T> T rvref();
119 template <typename T> T rvref(T);
120 #else // defined(BOOST_ASIO_HAS_MOVE)
121 template <typename T> const T& rvref();
122 template <typename T> const T& rvref(T);
123 #endif // defined(BOOST_ASIO_HAS_MOVE)
124 template <typename T> char argbyv(T);
125 
126 template <int>
127 struct handler_type_requirements
128 {
129 };
130 
131 #define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \
132     handler_type, handler) \
133   \
134   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
135       void()) asio_true_handler_type; \
136   \
137   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
138       sizeof(boost::asio::detail::zero_arg_copyable_handler_test( \
139           boost::asio::detail::clvref< \
140             asio_true_handler_type>(), 0)) == 1, \
141       "CompletionHandler type requirements not met") \
142   \
143   typedef boost::asio::detail::handler_type_requirements< \
144       sizeof( \
145         boost::asio::detail::argbyv( \
146           boost::asio::detail::clvref< \
147             asio_true_handler_type>())) + \
148       sizeof( \
149         boost::asio::detail::lvref< \
150           asio_true_handler_type>()(), \
151         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
152 
153 #define BOOST_ASIO_READ_HANDLER_CHECK( \
154     handler_type, handler) \
155   \
156   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
157       void(boost::system::error_code, std::size_t)) \
158     asio_true_handler_type; \
159   \
160   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
161       sizeof(boost::asio::detail::two_arg_handler_test( \
162           boost::asio::detail::rvref< \
163             asio_true_handler_type>(), \
164           static_cast<const boost::system::error_code*>(0), \
165           static_cast<const std::size_t*>(0))) == 1, \
166       "ReadHandler type requirements not met") \
167   \
168   typedef boost::asio::detail::handler_type_requirements< \
169       sizeof( \
170         boost::asio::detail::argbyv( \
171           boost::asio::detail::rvref< \
172             asio_true_handler_type>())) + \
173       sizeof( \
174         boost::asio::detail::lvref< \
175           asio_true_handler_type>()( \
176             boost::asio::detail::lvref<const boost::system::error_code>(), \
177             boost::asio::detail::lvref<const std::size_t>()), \
178         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
179 
180 #define BOOST_ASIO_WRITE_HANDLER_CHECK( \
181     handler_type, handler) \
182   \
183   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
184       void(boost::system::error_code, std::size_t)) \
185     asio_true_handler_type; \
186   \
187   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
188       sizeof(boost::asio::detail::two_arg_handler_test( \
189           boost::asio::detail::rvref< \
190             asio_true_handler_type>(), \
191           static_cast<const boost::system::error_code*>(0), \
192           static_cast<const std::size_t*>(0))) == 1, \
193       "WriteHandler type requirements not met") \
194   \
195   typedef boost::asio::detail::handler_type_requirements< \
196       sizeof( \
197         boost::asio::detail::argbyv( \
198           boost::asio::detail::rvref< \
199             asio_true_handler_type>())) + \
200       sizeof( \
201         boost::asio::detail::lvref< \
202           asio_true_handler_type>()( \
203             boost::asio::detail::lvref<const boost::system::error_code>(), \
204             boost::asio::detail::lvref<const std::size_t>()), \
205         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
206 
207 #define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
208     handler_type, handler) \
209   \
210   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
211       void(boost::system::error_code)) \
212     asio_true_handler_type; \
213   \
214   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
215       sizeof(boost::asio::detail::one_arg_handler_test( \
216           boost::asio::detail::rvref< \
217             asio_true_handler_type>(), \
218           static_cast<const boost::system::error_code*>(0))) == 1, \
219       "AcceptHandler type requirements not met") \
220   \
221   typedef boost::asio::detail::handler_type_requirements< \
222       sizeof( \
223         boost::asio::detail::argbyv( \
224           boost::asio::detail::rvref< \
225             asio_true_handler_type>())) + \
226       sizeof( \
227         boost::asio::detail::lvref< \
228           asio_true_handler_type>()( \
229             boost::asio::detail::lvref<const boost::system::error_code>()), \
230         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
231 
232 #define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \
233     handler_type, handler, socket_type) \
234   \
235   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
236       void(boost::system::error_code, socket_type)) \
237     asio_true_handler_type; \
238   \
239   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
240       sizeof(boost::asio::detail::two_arg_move_handler_test( \
241           boost::asio::detail::rvref< \
242             asio_true_handler_type>(), \
243           static_cast<const boost::system::error_code*>(0), \
244           static_cast<socket_type*>(0))) == 1, \
245       "MoveAcceptHandler type requirements not met") \
246   \
247   typedef boost::asio::detail::handler_type_requirements< \
248       sizeof( \
249         boost::asio::detail::argbyv( \
250           boost::asio::detail::rvref< \
251             asio_true_handler_type>())) + \
252       sizeof( \
253         boost::asio::detail::lvref< \
254           asio_true_handler_type>()( \
255             boost::asio::detail::lvref<const boost::system::error_code>(), \
256             boost::asio::detail::rvref<socket_type>()), \
257         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
258 
259 #define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
260     handler_type, handler) \
261   \
262   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
263       void(boost::system::error_code)) \
264     asio_true_handler_type; \
265   \
266   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
267       sizeof(boost::asio::detail::one_arg_handler_test( \
268           boost::asio::detail::rvref< \
269             asio_true_handler_type>(), \
270           static_cast<const boost::system::error_code*>(0))) == 1, \
271       "ConnectHandler type requirements not met") \
272   \
273   typedef boost::asio::detail::handler_type_requirements< \
274       sizeof( \
275         boost::asio::detail::argbyv( \
276           boost::asio::detail::rvref< \
277             asio_true_handler_type>())) + \
278       sizeof( \
279         boost::asio::detail::lvref< \
280           asio_true_handler_type>()( \
281             boost::asio::detail::lvref<const boost::system::error_code>()), \
282         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
283 
284 #define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \
285     handler_type, handler, endpoint_type) \
286   \
287   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
288       void(boost::system::error_code, endpoint_type)) \
289     asio_true_handler_type; \
290   \
291   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
292       sizeof(boost::asio::detail::two_arg_handler_test( \
293           boost::asio::detail::rvref< \
294             asio_true_handler_type>(), \
295           static_cast<const boost::system::error_code*>(0), \
296           static_cast<const endpoint_type*>(0))) == 1, \
297       "RangeConnectHandler type requirements not met") \
298   \
299   typedef boost::asio::detail::handler_type_requirements< \
300       sizeof( \
301         boost::asio::detail::argbyv( \
302           boost::asio::detail::rvref< \
303             asio_true_handler_type>())) + \
304       sizeof( \
305         boost::asio::detail::lvref< \
306           asio_true_handler_type>()( \
307             boost::asio::detail::lvref<const boost::system::error_code>(), \
308             boost::asio::detail::lvref<const endpoint_type>()), \
309         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
310 
311 #define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \
312     handler_type, handler, iter_type) \
313   \
314   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
315       void(boost::system::error_code, iter_type)) \
316     asio_true_handler_type; \
317   \
318   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
319       sizeof(boost::asio::detail::two_arg_handler_test( \
320           boost::asio::detail::rvref< \
321             asio_true_handler_type>(), \
322           static_cast<const boost::system::error_code*>(0), \
323           static_cast<const iter_type*>(0))) == 1, \
324       "IteratorConnectHandler type requirements not met") \
325   \
326   typedef boost::asio::detail::handler_type_requirements< \
327       sizeof( \
328         boost::asio::detail::argbyv( \
329           boost::asio::detail::rvref< \
330             asio_true_handler_type>())) + \
331       sizeof( \
332         boost::asio::detail::lvref< \
333           asio_true_handler_type>()( \
334             boost::asio::detail::lvref<const boost::system::error_code>(), \
335             boost::asio::detail::lvref<const iter_type>()), \
336         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
337 
338 #define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
339     handler_type, handler, range_type) \
340   \
341   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
342       void(boost::system::error_code, range_type)) \
343     asio_true_handler_type; \
344   \
345   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
346       sizeof(boost::asio::detail::two_arg_handler_test( \
347           boost::asio::detail::rvref< \
348             asio_true_handler_type>(), \
349           static_cast<const boost::system::error_code*>(0), \
350           static_cast<const range_type*>(0))) == 1, \
351       "ResolveHandler type requirements not met") \
352   \
353   typedef boost::asio::detail::handler_type_requirements< \
354       sizeof( \
355         boost::asio::detail::argbyv( \
356           boost::asio::detail::rvref< \
357             asio_true_handler_type>())) + \
358       sizeof( \
359         boost::asio::detail::lvref< \
360           asio_true_handler_type>()( \
361             boost::asio::detail::lvref<const boost::system::error_code>(), \
362             boost::asio::detail::lvref<const range_type>()), \
363         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
364 
365 #define BOOST_ASIO_WAIT_HANDLER_CHECK( \
366     handler_type, handler) \
367   \
368   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
369       void(boost::system::error_code)) \
370     asio_true_handler_type; \
371   \
372   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
373       sizeof(boost::asio::detail::one_arg_handler_test( \
374           boost::asio::detail::rvref< \
375             asio_true_handler_type>(), \
376           static_cast<const boost::system::error_code*>(0))) == 1, \
377       "WaitHandler type requirements not met") \
378   \
379   typedef boost::asio::detail::handler_type_requirements< \
380       sizeof( \
381         boost::asio::detail::argbyv( \
382           boost::asio::detail::rvref< \
383             asio_true_handler_type>())) + \
384       sizeof( \
385         boost::asio::detail::lvref< \
386           asio_true_handler_type>()( \
387             boost::asio::detail::lvref<const boost::system::error_code>()), \
388         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
389 
390 #define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \
391     handler_type, handler) \
392   \
393   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
394       void(boost::system::error_code, int)) \
395     asio_true_handler_type; \
396   \
397   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
398       sizeof(boost::asio::detail::two_arg_handler_test( \
399           boost::asio::detail::rvref< \
400             asio_true_handler_type>(), \
401           static_cast<const boost::system::error_code*>(0), \
402           static_cast<const int*>(0))) == 1, \
403       "SignalHandler type requirements not met") \
404   \
405   typedef boost::asio::detail::handler_type_requirements< \
406       sizeof( \
407         boost::asio::detail::argbyv( \
408           boost::asio::detail::rvref< \
409             asio_true_handler_type>())) + \
410       sizeof( \
411         boost::asio::detail::lvref< \
412           asio_true_handler_type>()( \
413             boost::asio::detail::lvref<const boost::system::error_code>(), \
414             boost::asio::detail::lvref<const int>()), \
415         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
416 
417 #define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \
418     handler_type, handler) \
419   \
420   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
421       void(boost::system::error_code)) \
422     asio_true_handler_type; \
423   \
424   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
425       sizeof(boost::asio::detail::one_arg_handler_test( \
426           boost::asio::detail::rvref< \
427             asio_true_handler_type>(), \
428           static_cast<const boost::system::error_code*>(0))) == 1, \
429       "HandshakeHandler type requirements not met") \
430   \
431   typedef boost::asio::detail::handler_type_requirements< \
432       sizeof( \
433         boost::asio::detail::argbyv( \
434           boost::asio::detail::rvref< \
435             asio_true_handler_type>())) + \
436       sizeof( \
437         boost::asio::detail::lvref< \
438           asio_true_handler_type>()( \
439             boost::asio::detail::lvref<const boost::system::error_code>()), \
440         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
441 
442 #define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
443     handler_type, handler) \
444   \
445   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
446       void(boost::system::error_code, std::size_t)) \
447     asio_true_handler_type; \
448   \
449   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
450       sizeof(boost::asio::detail::two_arg_handler_test( \
451           boost::asio::detail::rvref< \
452             asio_true_handler_type>(), \
453           static_cast<const boost::system::error_code*>(0), \
454           static_cast<const std::size_t*>(0))) == 1, \
455       "BufferedHandshakeHandler type requirements not met") \
456   \
457   typedef boost::asio::detail::handler_type_requirements< \
458       sizeof( \
459         boost::asio::detail::argbyv( \
460           boost::asio::detail::rvref< \
461             asio_true_handler_type>())) + \
462       sizeof( \
463         boost::asio::detail::lvref< \
464           asio_true_handler_type>()( \
465           boost::asio::detail::lvref<const boost::system::error_code>(), \
466           boost::asio::detail::lvref<const std::size_t>()), \
467         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
468 
469 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
470     handler_type, handler) \
471   \
472   typedef BOOST_ASIO_HANDLER_TYPE(handler_type, \
473       void(boost::system::error_code)) \
474     asio_true_handler_type; \
475   \
476   BOOST_ASIO_HANDLER_TYPE_REQUIREMENTS_ASSERT( \
477       sizeof(boost::asio::detail::one_arg_handler_test( \
478           boost::asio::detail::rvref< \
479             asio_true_handler_type>(), \
480           static_cast<const boost::system::error_code*>(0))) == 1, \
481       "ShutdownHandler type requirements not met") \
482   \
483   typedef boost::asio::detail::handler_type_requirements< \
484       sizeof( \
485         boost::asio::detail::argbyv( \
486           boost::asio::detail::rvref< \
487             asio_true_handler_type>())) + \
488       sizeof( \
489         boost::asio::detail::lvref< \
490           asio_true_handler_type>()( \
491             boost::asio::detail::lvref<const boost::system::error_code>()), \
492         char(0))> BOOST_ASIO_UNUSED_TYPEDEF
493 
494 #else // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
495 
496 #define BOOST_ASIO_LEGACY_COMPLETION_HANDLER_CHECK( \
497     handler_type, handler) \
498   typedef int BOOST_ASIO_UNUSED_TYPEDEF
499 
500 #define BOOST_ASIO_READ_HANDLER_CHECK( \
501     handler_type, handler) \
502   typedef int BOOST_ASIO_UNUSED_TYPEDEF
503 
504 #define BOOST_ASIO_WRITE_HANDLER_CHECK( \
505     handler_type, handler) \
506   typedef int BOOST_ASIO_UNUSED_TYPEDEF
507 
508 #define BOOST_ASIO_ACCEPT_HANDLER_CHECK( \
509     handler_type, handler) \
510   typedef int BOOST_ASIO_UNUSED_TYPEDEF
511 
512 #define BOOST_ASIO_MOVE_ACCEPT_HANDLER_CHECK( \
513     handler_type, handler, socket_type) \
514   typedef int BOOST_ASIO_UNUSED_TYPEDEF
515 
516 #define BOOST_ASIO_CONNECT_HANDLER_CHECK( \
517     handler_type, handler) \
518   typedef int BOOST_ASIO_UNUSED_TYPEDEF
519 
520 #define BOOST_ASIO_RANGE_CONNECT_HANDLER_CHECK( \
521     handler_type, handler, iter_type) \
522   typedef int BOOST_ASIO_UNUSED_TYPEDEF
523 
524 #define BOOST_ASIO_ITERATOR_CONNECT_HANDLER_CHECK( \
525     handler_type, handler, iter_type) \
526   typedef int BOOST_ASIO_UNUSED_TYPEDEF
527 
528 #define BOOST_ASIO_RESOLVE_HANDLER_CHECK( \
529     handler_type, handler, iter_type) \
530   typedef int BOOST_ASIO_UNUSED_TYPEDEF
531 
532 #define BOOST_ASIO_WAIT_HANDLER_CHECK( \
533     handler_type, handler) \
534   typedef int BOOST_ASIO_UNUSED_TYPEDEF
535 
536 #define BOOST_ASIO_SIGNAL_HANDLER_CHECK( \
537     handler_type, handler) \
538   typedef int BOOST_ASIO_UNUSED_TYPEDEF
539 
540 #define BOOST_ASIO_HANDSHAKE_HANDLER_CHECK( \
541     handler_type, handler) \
542   typedef int BOOST_ASIO_UNUSED_TYPEDEF
543 
544 #define BOOST_ASIO_BUFFERED_HANDSHAKE_HANDLER_CHECK( \
545     handler_type, handler) \
546   typedef int BOOST_ASIO_UNUSED_TYPEDEF
547 
548 #define BOOST_ASIO_SHUTDOWN_HANDLER_CHECK( \
549     handler_type, handler) \
550   typedef int BOOST_ASIO_UNUSED_TYPEDEF
551 
552 #endif // !defined(BOOST_ASIO_ENABLE_HANDLER_TYPE_REQUIREMENTS)
553 
554 } // namespace detail
555 } // namespace asio
556 } // namespace boost
557 
558 #endif // BOOST_ASIO_DETAIL_HANDLER_TYPE_REQUIREMENTS_HPP
559