]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/beast/test/beast/websocket/handshake.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / beast / test / beast / websocket / handshake.cpp
index e5ea4004cd4fb4edb0906c8e09673200cfb173af..5723415eb375162386c3c28742c447349df52289 100644 (file)
@@ -18,6 +18,9 @@
 #include <boost/asio/io_context.hpp>
 #include <boost/asio/strand.hpp>
 #include <thread>
+#if BOOST_ASIO_HAS_CO_AWAIT
+#include <boost/asio/use_awaitable.hpp>
+#endif
 
 namespace boost {
 namespace beast {
@@ -704,6 +707,23 @@ public:
         }
     }
 
+#if BOOST_ASIO_HAS_CO_AWAIT
+    void testAwaitableCompiles(
+        stream<test::stream>& s,
+        std::string host,
+        std::string port,
+        response_type& resp)
+    {
+        static_assert(std::is_same_v<
+            net::awaitable<void>, decltype(
+            s.async_handshake(host, port, net::use_awaitable))>);
+
+        static_assert(std::is_same_v<
+            net::awaitable<void>, decltype(
+            s.async_handshake(resp, host, port, net::use_awaitable))>);
+    }
+#endif
+
     void
     run() override
     {
@@ -714,6 +734,9 @@ public:
         testMoveOnly();
         testAsync();
         testIssue1460();
+#if BOOST_ASIO_HAS_CO_AWAIT
+        boost::ignore_unused(&handshake_test::testAwaitableCompiles);
+#endif
     }
 };