diff --git a/include/boost/bind/make_adaptable.hpp b/include/boost/bind/make_adaptable.hpp index 01a1d4d..6809198 100644 --- a/include/boost/bind/make_adaptable.hpp +++ b/include/boost/bind/make_adaptable.hpp @@ -18,10 +18,6 @@ namespace boost namespace _bi { -template void instantiate(F) -{ -} - template class af0 { public: @@ -37,6 +33,11 @@ public: return f_(); } + result_type operator()() const + { + return f_(); + } + private: F f_; @@ -59,6 +60,11 @@ public: return f_(a1); } + result_type operator()(A1 a1) const + { + return f_(a1); + } + private: F f_; @@ -83,6 +89,11 @@ public: return f_(a1, a2); } + result_type operator()(A1 a1, A2 a2) const + { + return f_(a1, a2); + } + private: F f_; @@ -106,6 +117,11 @@ public: return f_(a1, a2, a3); } + result_type operator()(A1 a1, A2 a2, A3 a3) const + { + return f_(a1, a2, a3); + } + private: F f_; @@ -130,6 +146,11 @@ public: return f_(a1, a2, a3, a4); } + result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4) const + { + return f_(a1, a2, a3, a4); + } + private: F f_; @@ -139,31 +160,26 @@ private: template _bi::af0 make_adaptable(F f) { - _bi::instantiate( &_bi::af0::operator() ); // for early error detection return _bi::af0(f); } template _bi::af1 make_adaptable(F f) { - instantiate( &_bi::af1::operator() ); return _bi::af1(f); } template _bi::af2 make_adaptable(F f) { - instantiate( &_bi::af2::operator() ); return _bi::af2(f); } template _bi::af3 make_adaptable(F f) { - instantiate( &_bi::af3::operator() ); return _bi::af3(f); } template _bi::af4 make_adaptable(F f) { - instantiate( &_bi::af4::operator() ); return _bi::af4(f); }