Subject: [Boost-bugs] [Boost C++ Libraries] #6278: mem_fn has a different result_type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-16 10:54:47
#6278: mem_fn has a different result_type
-----------------------------------+----------------------------------------
Reporter: giecrilj@⦠| Owner: pdimov
Type: Bugs | Status: new
Milestone: To Be Determined | Component: bind
Version: Boost 1.48.0 | Severity: Problem
Keywords: |
-----------------------------------+----------------------------------------
The following code does not compile:
{{{
#!c++
/*
<URL:
file://localhost/usr/share/doc/packages/boost-1.44.0/libs/bind/mem_fn.html#Purpose
>
All function objects returned by mem_fn expose a result_type typedef
that represents the return type of the member function. For data
members, result_type is defined as the type of the member.
*/
typedef int type_of_the_member;
struct U { type_of_the_member m; };
template < class F >
typename F ::result_type U_m (F const &t, U &u)
{ typedef typename F:: result_type r; typedef type_of_the_member r;
typename F:: result_type r1; return t (u); }
U u; int x ((U_m (::boost ::mem_fn (&U ::m), u)));
}}}
[http://codepad.org/1op6p2Mc codepad] says: ''error: conflicting
declaration 'typedef type_of_the_member r' ''
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6278> 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:08 UTC