| 1 |
// PR c++/42266 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template<typename... _Elements> |
| 5 |
class tuple; |
| 6 |
|
| 7 |
template<typename _Arg> |
| 8 |
class _Mu; |
| 9 |
|
| 10 |
template<typename _Signature> |
| 11 |
struct _Bind; |
| 12 |
|
| 13 |
template<typename _Functor, typename... _Bound_args> |
| 14 |
class _Bind<_Functor(_Bound_args...)> |
| 15 |
{ |
| 16 |
template<typename... _Args, typename |
| 17 |
= decltype(_Functor()(_Mu<_Bound_args>()(_Bound_args(), |
| 18 |
tuple<_Args...>())...) )> |
| 19 |
void __call() { } |
| 20 |
}; |
| 21 |
|
| 22 |
template<typename _Functor, typename _Arg> |
| 23 |
_Bind<_Functor(_Arg)> |
| 24 |
bind(_Functor, _Arg) { return _Bind<_Functor(_Arg)>(); } |
| 25 |
|
| 26 |
struct State |
| 27 |
{ |
| 28 |
bool ready() { return true; } |
| 29 |
|
| 30 |
void f() |
| 31 |
{ |
| 32 |
bind(&State::ready, this); |
| 33 |
} |
| 34 |
}; |
| 35 |
|