From 7bab8d55dca866335efe8ea4c335422c20f2e408 Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Tue, 4 Apr 2023 20:17:55 +1000 Subject: [PATCH] Ensure this_coro helper structs have explicit 1-arg constructors. To prevent implicit conversion in co_await expressions. --- include/boost/asio/this_coro.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/asio/this_coro.hpp b/include/boost/asio/this_coro.hpp index b874edf0..69abf1c1 100644 --- a/include/boost/asio/this_coro.hpp +++ b/include/boost/asio/this_coro.hpp @@ -194,7 +194,7 @@ template struct reset_cancellation_state_1_t { template - BOOST_ASIO_CONSTEXPR reset_cancellation_state_1_t( + explicit BOOST_ASIO_CONSTEXPR reset_cancellation_state_1_t( BOOST_ASIO_MOVE_ARG(F) filt) : filter(BOOST_ASIO_MOVE_CAST(F)(filt)) { @@ -257,7 +257,7 @@ throw_if_cancelled() struct throw_if_cancelled_1_t { - BOOST_ASIO_CONSTEXPR throw_if_cancelled_1_t(bool val) + explicit BOOST_ASIO_CONSTEXPR throw_if_cancelled_1_t(bool val) : value(val) { }