kea 2.x doesn't build with boost175+ with gcc 8.x
name: Bug report
about: kea 2.x doesn't build with boost175+
Steps to reproduce the behavior:
- Build kea 2.0 or 2.2 against boost175
- Get template error
This is the full gnarly error:
io_service.cc:122:33: required from here
/usr/include/boost/asio/impl/io_context.hpp:201:58: error: no matching function for call to 'async_initiate<const isc::asiolink::{anonymous}::CallbackWrapper&, void()>(boost::asio::io_context::initiate_post, const isc::asiolink::{anonymous}::CallbackWrapper&, boost::asio::io_context*)'
return async_initiate<LegacyCompletionHandler, void ()>(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
initiate_post(), handler, this);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/asio/detail/handler_type_requirements.hpp:53,
from /usr/include/boost/asio/impl/execution_context.hpp:18,
from /usr/include/boost/asio/execution_context.hpp:409,
from /usr/include/boost/asio/detail/scheduler.hpp:21,
from /usr/include/boost/asio/system_context.hpp:19,
from /usr/include/boost/asio/impl/system_executor.hpp:22,
from /usr/include/boost/asio/system_executor.hpp:662,
from /usr/include/boost/asio/associated_executor.hpp:22,
from /usr/include/boost/asio.hpp:21,
from ../../../src/lib/asiolink/asio_wrapper.h:75,
from io_service.cc:8:
/usr/include/boost/asio/async_result.hpp:360:1: note: candidate: 'template<class CompletionToken, class Signature, class Initiation, class ... Args> requires completion_signature<Signature> typename std::enable_if<boost::asio::detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, decltype (boost::asio::async_result<typename std::decay<_Tp>::type, Signature>::initiate(declval<Initiation&&>(), declval<CompletionToken&&>(), (declval<Args&>)()...))>::type boost::asio::async_initiate(Initiation&&, CompletionToken&, Args&& ...)'
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
^~~~~~~~~~~~~~
/usr/include/boost/asio/async_result.hpp:360:1: note: template argument deduction/substitution failed:
/usr/include/boost/asio/async_result.hpp: In substitution of 'template<class CompletionToken, class Signature, class Initiation, class ... Args> requires completion_signature<Signature> typename std::enable_if<boost::asio::detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value, decltype (boost::asio::async_result<typename std::decay<_Tp>::type, Signature>::initiate(declval<Initiation&&>(), declval<CompletionToken&&>(), (declval<Args&>)()...))>::type boost::asio::async_initiate(Initiation&&, CompletionToken&, Args&& ...) [with CompletionToken = const isc::asiolink::{anonymous}::CallbackWrapper&; Signature = void(); Initiation = boost::asio::io_context::initiate_post; Args = {boost::asio::io_context*}]':
/usr/include/boost/asio/impl/io_context.hpp:201:58: required from 'auto boost::asio::io_context::post(LegacyCompletionHandler&&) [with LegacyCompletionHandler = const isc::asiolink::{anonymous}::CallbackWrapper&]'
io_service.cc:122:33: required from here
/usr/include/boost/asio/async_result.hpp:355:5: error: no matching function for call to 'boost::asio::async_result<isc::asiolink::{anonymous}::CallbackWrapper, void()>::initiate(boost::asio::io_context::initiate_post, const isc::asiolink::{anonymous}::CallbackWrapper&, boost::asio::io_context*)'
BOOST_ASIO_INITFN_DEDUCED_RESULT_TYPE(CompletionToken, Signature,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/asio/async_result.hpp:147:22: note: candidate: 'static boost::asio::async_result<CompletionToken, Signature>::return_type boost::asio::async_result<CompletionToken, Signature>::initiate(Initiation&&, RawCompletionToken&&, Args&& ...) [with Initiation = boost::asio::io_context::initiate_post; RawCompletionToken = const isc::asiolink::{anonymous}::CallbackWrapper&; Args = {boost::asio::io_context*}; CompletionToken = isc::asiolink::{anonymous}::CallbackWrapper; Signature = void(); boost::asio::async_result<CompletionToken, Signature>::return_type = void]'
static return_type initiate(
^~~~~~~~
/usr/include/boost/asio/async_result.hpp:147:22: note: constraints not satisfied
/usr/include/boost/asio/async_result.hpp:70:20: note: within 'template<class T, class Signature> concept const bool boost::asio::completion_handler_for<T, Signature> [with T = const isc::asiolink::{anonymous}::CallbackWrapper&; Signature = void()]'
BOOST_ASIO_CONCEPT completion_handler_for =
^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/asio/async_result.hpp:70:20: note: 'boost::asio::detail::is_completion_handler_for<const isc::asiolink::<unnamed>::CallbackWrapper&, void()>::value' evaluated to false
/usr/include/boost/asio/impl/io_context.hpp: In instantiation of 'auto boost::asio::io_context::post(LegacyCompletionHandler&&) [with LegacyCompletionHandler = const isc::asiolink::{anonymous}::CallbackWrapper&]':
io_service.cc:122:33: required from here
/usr/include/boost/asio/async_result.hpp:376:1: note: candidate: 'template<class CompletionToken, class Signature, class Initiation, class ... Args> requires completion_signature<Signature> typename std::enable_if<(! boost::asio::detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value), typename boost::asio::async_result<typename std::decay<_Tp>::type, Signature>::return_type>::type boost::asio::async_initiate(Initiation&&, CompletionToken&, Args&& ...)'
async_initiate(BOOST_ASIO_MOVE_ARG(Initiation) initiation,
^~~~~~~~~~~~~~
/usr/include/boost/asio/async_result.hpp:376:1: note: template argument deduction/substitution failed:
/usr/include/boost/asio/async_result.hpp: In substitution of 'template<class CompletionToken, class Signature, class Initiation, class ... Args> requires completion_signature<Signature> typename std::enable_if<(! boost::asio::detail::async_result_has_initiate_memfn<CompletionToken, Signature>::value), typename boost::asio::async_result<typename std::decay<_Tp>::type, Signature>::return_type>::type boost::asio::async_initiate(Initiation&&, CompletionToken&, Args&& ...) [with CompletionToken = const isc::asiolink::{anonymous}::CallbackWrapper&; Signature = void(); Initiation = <missing>; Args = <missing>]':
/usr/include/boost/asio/impl/io_context.hpp:201:58: required from 'auto boost::asio::io_context::post(LegacyCompletionHandler&&) [with LegacyCompletionHandler = const isc::asiolink::{anonymous}::CallbackWrapper&]'
io_service.cc:122:33: required from here
/usr/include/boost/asio/async_result.hpp:376:1: error: no type named 'type' in 'struct std::enable_if<false, void>'
Something about CallbackWrapper causes the problem. This is enough to fix the issue in my case, since I don't care about SunStudio compatibility.
+++ src/lib/asiolink/io_service.cc
///
/// \param callback The callback to be run on the IO service.
void post(const std::function<void ()>& callback) {
- const CallbackWrapper wrapper(callback);
- io_service_.post(wrapper);
+ io_service_.post(callback);
Edited by Tomek Mrugalski