This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42132] [C++0x] SFINAE failure with cv-qualifiers
- From: "redi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Nov 2009 17:32:47 -0000
- Subject: [Bug c++/42132] [C++0x] SFINAE failure with cv-qualifiers
- References: <bug-42132-16379@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from redi at gcc dot gnu dot org 2009-11-22 17:32 -------
I'll try that now. Something like:
template<typename F>
struct Bind
{
F func;
template<typename... Arg, typename SfinaeT = decltype( declval<F>()
(declval<Arg>()...) )>
typename result_of<F(Arg...)>::type
call(Arg&&... a)
{
return func( std::forward<Arg>(a)... );
}
template<typename... Arg, typename SfinaeT = decltype( declval<const F>()
(declval<Arg>()...) )>
typename result_of<const F(Arg...)>::type
call(Arg&&... a) const
{
return func( std::forward<Arg>(a)... );
}
};
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42132