Skip to content

Draft: fix template argument deduction failure on CentOS 7

Andrei Pavel requested to merge 2815-build-failure-on-centos-7 into master

Closes #2815 (closed) a consecutive time.

Fixes this build failure on CentOS 7.

 cfg_hosts.cc:1106:69: error: no matching function for call to 'distance(const boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::index_node_base<isc::dhcp::HostResrv6Tuple, std::allocator<isc::dhcp::HostResrv6Tuple> > > > > > >&, const boost::multi_index::detail::bidir_node_iterator<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::ordered_index_node<boost::multi_index::detail::index_node_base<isc::dhcp::HostResrv6Tuple, std::allocator<isc::dhcp::HostResrv6Tuple> > > > > > >&)'
          erased_addresses = boost::distance(range.first, range.second);
                                                                      ^
 cfg_hosts.cc:1106:69: note: candidate is:
 In file included from /usr/include/boost/range/functions.hpp:21:0,
                  from /usr/include/boost/range/iterator_range_core.hpp:26,
                  from /usr/include/boost/lexical_cast.hpp:169,
                  from ../../../src/lib/util/strutil.h:18,
                  from ../../../src/lib/dhcp/duid.h:11,
                  from cfg_hosts.cc:8:
 /usr/include/boost/range/distance.hpp:27:5: note: template<class T> typename boost::range_difference<T>::type boost::distance(const T&)
      distance( const T& r )
      ^
 /usr/include/boost/range/distance.hpp:27:5: note:   template argument deduction/substitution failed:
 cfg_hosts.cc:1106:69: note:   candidate expects 1 argument, 2 provided
          erased_addresses = boost::distance(range.first, range.second);
                                                                      ^

Occurence: https://jenkins.aws.isc.org/job/kea-dev/job/ut-basic/1110/

Merge request reports