This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/39136] std::mem_fun_ref fails to accept a member function whose second argument with default value



------- Comment #3 from fang at csl dot cornell dot edu  2009-02-09 15:58 -------
Subject: Re:  std::mem_fun_ref fails to accept a member
 function whose second argument with default value

> ------- Comment #2 from paolo dot carlini at oracle dot com  2009-02-09 09:53 -------
> (In reply to comment #0)
>> I'm not sure if this is valid code.  However, the standard seems to indicate
>> that resize(size_type), is a required member function (or at least interface)
>> of std::vector.
>
> Which standard? To be clear, in the current one, the function is
> resize(size_type sz, T c = T()).

I'm looking at the current draft, n2798.
23.2.6.2/10-11 [vector.capacity]
which lists both forms of resize().
Yes, libstdc++ covers both by using the trailing default argument, but I 
still can't pass it to mem_fun/mem_fun_ref.

Compilation still fails with both -std=c++0x and -std=c++98 with the 
above test case.  (Test case contains a stray line "Test case:" from 
mis-pasting, my bad.)

> Otherwise, the C++0x overloads require concepts (and I think we also have an
> open PR about that)

Got a PR reference handy?

Fang

David Fang
http://www.csl.cornell.edu/~fang/
http://www.achronix.com/


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39136


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]