[Boost-bugs] [Boost C++ Libraries] #6755: [result_of] Inconsistent results between function references and function pointers

Subject: [Boost-bugs] [Boost C++ Libraries] #6755: [result_of] Inconsistent results between function references and function pointers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-04-01 03:28:28


#6755: [result_of] Inconsistent results between function references and function
pointers
-------------------------------------+--------------------------------------
 Reporter: michel | Owner: djwalker
     Type: Patches | Status: new
Milestone: To Be Determined | Component: utility
  Version: Boost Development Trunk | Severity: Problem
 Keywords: C++11 |
-------------------------------------+--------------------------------------
 For function references, decltype-based `boost::result_of` uses `decltype`
 to determine the type. But, for function pointers, decltype-based
 `boost::result_of`
 falls back to `boost::tr1_result_of` and does not use `decltype`.

 This inconsistency makes different results for function references and
 function pointers.
 On clang trunk and gcc-4.7 in a C++11 mode, for "`typedef const int
 F();`",
 * decltype-based `boost::result_of<F&()>` is `int`, but
 * decltype-based `boost::result_of<F*()>` is `const int`.

 To remove the inconsistency,
 decltype-based `boost::result_of` should use `decltype` for function
 pointers.

 A patch attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6755>
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:09 UTC