[Boost-bugs] [Boost C++ Libraries] #8406: boost::_bi::result_traits should handle function pointers

Subject: [Boost-bugs] [Boost C++ Libraries] #8406: boost::_bi::result_traits should handle function pointers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-05 15:41:35


#8406: boost::_bi::result_traits should handle function pointers
-------------------------------------+--------------------------------------
 Reporter: jason@… | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: bind
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 I recently modified G++ to enforce the rule that forming a function type
 with an abstract class as a return or parameter type causes a substitution
 failure. So now we instantiate return/parameter types during substitution
 in order to check whether they are abstract. I've gotten a bug report
 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56838) that this breaks
 boost/bind; a trivial example like
 {{{
 #include <boost/bind.hpp>
 void f();
 int main() { boost::bind(&f); }
 }}}
 causes an error because while forming overload candidates we end up trying
 to instantiate result_traits<unspecified, void(*)()>, which fails.

 It seems to me that instead of (or in addition to) all the overloads of
 bind in bind_cc.hpp, there should be partial specializations of
 result_traits to deal with function pointers; then the generic function
 object overload would handle them. That is, specializations like
 {{{
 template<class R>
 struct result_traits<unspecified, BOOST_BIND_ST R (BOOST_BIND_CC *)()>
 {
   typedef R type;
 }
 }}}
 The committee may well decide that the G++ behavior is wrong and we should
 adjust the standard accordingly, but it still seems that this would be an
 improvement to boost.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8406>
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 : 2017-02-16 18:50:12 UTC