// Copyright (c) 2020 Casey Bodley (cbodley at redhat dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #include // make assertions about async_result::return_type with different signatures // this is a compilation test only template struct yield_result : boost::asio::async_result {}; template struct yield_returns : std::is_same::return_type> {}; // no return value static_assert(yield_returns::value, "wrong return value for void()"); static_assert(yield_returns::value, "wrong return value for void(error_code)"); // single-parameter return value static_assert(yield_returns::value, "wrong return value for void(int)"); static_assert(yield_returns::value, "wrong return value for void(error_code, int)"); // multiple-parameter return value static_assert(yield_returns, void(int, std::string)>::value, "wrong return value for void(int, string)"); static_assert(yield_returns, void(boost::system::error_code, int, std::string)>::value, "wrong return value for void(error_code, int, string)"); // single-tuple-parameter return value static_assert(yield_returns, void(std::tuple)>::value, "wrong return value for void(std::tuple)"); static_assert(yield_returns, void(boost::system::error_code, std::tuple)>::value, "wrong return value for void(error_code, std::tuple)"); // single-pair-parameter return value static_assert(yield_returns, void(std::pair)>::value, "wrong return value for void(std::tuple)"); static_assert(yield_returns, void(boost::system::error_code, std::pair)>::value, "wrong return value for void(error_code, std::tuple)");