This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/52917] [DR 2048] explicitly stated return type in std::mem_fn cannot be compiled
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Apr 2012 21:35:07 +0000
- Subject: [Bug libstdc++/52917] [DR 2048] explicitly stated return type in std::mem_fn cannot be compiled
- Auto-submitted: auto-generated
- References: <bug-52917-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52917
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-09 21:35:07 UTC ---
(In reply to comment #1)
> Or you can do
>
> auto y = std::mem_fn((int& (X::*)())&X::get );
Or
auto y = std::mem_fn <int&()>(&X::get );
Which should also work with either libstdc++ or libc++