This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
- 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, 14 Mar 2011 18:10:33 +0000
- Subject: [Bug libstdc++/48113] [4.6/4.7 Regression] [C++0x] bind with tuple argument fails
- Auto-submitted: auto-generated
- References: <bug-48113-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48113
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-03-14 18:10:19 UTC ---
here's one even closer to what we actually have in the library, where the
default template argument R involves the deduced type A as well:
template<typename T> T declval();
struct tuple { };
struct F1
{
void operator()(tuple, int);
};
typedef void (*F2)(tuple, int);
template<typename F, typename T>
struct Bind
{
template<typename A,
typename R = decltype( F()(declval<T&>(), A()) )>
R f(A);
template<typename A,
typename R = decltype( F()(declval<volatile T&>(), A()) )>
R f(A) volatile;
};
int main()
{
Bind<F1, tuple>().f(0); // OK
Bind<F2, tuple>().f(0); // ERROR
}