Re: [Boost-bugs] [Boost C++ Libraries] #13012: boost::has_equal_to fails with captureless lambda expression types

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13012: boost::has_equal_to fails with captureless lambda expression types
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2018-02-20 09:36:52


#13012: boost::has_equal_to fails with captureless lambda expression types
------------------------------------+--------------------------
  Reporter: Joaquín M López Muñoz | Owner: John Maddock
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: type_traits
   Version: Boost 1.63.0 | Severity: Problem
Resolution: fixed | Keywords:
------------------------------------+--------------------------

Comment (by anonymous):

 Umm, Ive run the following in Visual Studio 2015 against develop

 {{{
 #include <boost/type_traits/has_equal_to.hpp>
 #include <iostream>

 int main()
 {
   auto f=[](int){return 0;};
 std::cout<<boost::has_equal_to<decltype(f),decltype(f),bool>::value<<"\n";
 }
 }}}

 and compiler fails with:

 {{{
 1>------ Build started: Project: sandbox, Configuration: Debug Win32
 ------
 1> sandbox.cpp
 1>d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(212): error
 C2593: 'operator ==' is ambiguous
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(124): note:
 could be 'boost::detail::has_equal_to_impl::no_operator
 boost::detail::has_equal_to_impl::operator ==(const
 boost::detail::has_equal_to_impl::any &,const
 boost::detail::has_equal_to_impl::any &)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(212): note:
 while trying to match the argument list
 '(main::<lambda_7042359f6847725571dfbc3d7e478577>,
 main::<lambda_7042359f6847725571dfbc3d7e478577>)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(233): note:
 see reference to class template instantiation
 'boost::detail::has_equal_to_impl::operator_exists<Lhs,Rhs>' being
 compiled
 1> with
 1> [
 1> Lhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Rhs=main::<lambda_7042359f6847725571dfbc3d7e478577>
 1> ]
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(262): note:
 see reference to class template instantiation
 'boost::detail::has_equal_to_impl::trait_impl1<main::<lambda_7042359f6847725571dfbc3d7e478577>,main::<lambda_7042359f6847725571dfbc3d7e478577>,Ret,false>'
 being compiled
 1> with
 1> [
 1> Ret=bool
 1> ]
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(270): note:
 see reference to class template instantiation
 'boost::detail::has_equal_to_impl::trait_impl<Lhs,Rhs,Ret>' being compiled
 1> with
 1> [
 1> Lhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Rhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Ret=bool
 1> ]
 1> d:\usr\joaquin\proyectos\poly_collection\sandbox\sandbox.cpp(9): note:
 see reference to class template instantiation
 'boost::has_equal_to<main::<lambda_7042359f6847725571dfbc3d7e478577>,main::<lambda_7042359f6847725571dfbc3d7e478577>,bool>'
 being compiled
 1>d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(149): error
 C2593: 'operator ==' is ambiguous
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(124): note:
 could be 'boost::detail::has_equal_to_impl::no_operator
 boost::detail::has_equal_to_impl::operator ==(const
 boost::detail::has_equal_to_impl::any &,const
 boost::detail::has_equal_to_impl::any &)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(149): note:
 while trying to match the argument list
 '(main::<lambda_7042359f6847725571dfbc3d7e478577>,
 main::<lambda_7042359f6847725571dfbc3d7e478577>)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(233): note:
 see reference to class template instantiation
 'boost::detail::has_equal_to_impl::operator_returns_void<Lhs,Rhs>' being
 compiled
 1> with
 1> [
 1> Lhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Rhs=main::<lambda_7042359f6847725571dfbc3d7e478577>
 1> ]
 1>d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(194): error
 C2593: 'operator ==' is ambiguous
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(124): note:
 could be 'boost::detail::has_equal_to_impl::no_operator
 boost::detail::has_equal_to_impl::operator ==(const
 boost::detail::has_equal_to_impl::any &,const
 boost::detail::has_equal_to_impl::any &)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(194): note:
 while trying to match the argument list
 '(main::<lambda_7042359f6847725571dfbc3d7e478577>,
 main::<lambda_7042359f6847725571dfbc3d7e478577>)'
 1> d:\usr\joaquin\proyectos\boost-
 repo\trunk\boost\type_traits\detail\has_binary_operator.hpp(233): note:
 see reference to class template instantiation
 'boost::detail::has_equal_to_impl::operator_returns_Ret<Lhs,Rhs,Ret,false>'
 being compiled
 1> with
 1> [
 1> Lhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Rhs=main::<lambda_7042359f6847725571dfbc3d7e478577>,
 1> Ret=bool
 1> ]
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/ticket/13012#comment:11>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2018-02-20 09:41:22 UTC