#pragma once #include #include #include using cgv::type::func::make_argument; using cgv::type::func::clean; namespace cgv { namespace signal { /* functors *******************************************************************/ template struct fct_functor; template struct mtd_functor; template struct const_mtd_functor; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() () const { return fp(); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() () const { return (ip->*mp)(); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)() const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() () const { return (ip->*mp)(); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1) const { return fp(const_cast::type>(v1)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1) const { return (ip->*mp)(const_cast::type>(v1)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1) const { return (ip->*mp)(const_cast::type>(v1)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2) const { return fp(const_cast::type>(v1), const_cast::type>(v2)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3, T4); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3, T4); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3, T4) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3, T4, T5); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3, T4, T5); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3, T4, T5) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3, T4, T5, T6); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3, T4, T5, T6); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3, T4, T5, T6) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3, T4, T5, T6, T7); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3, T4, T5, T6, T7); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3, T4, T5, T6, T7) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7)); } }; template struct fct_functor { typedef R return_type; static const bool is_void = false; typedef R (*function_ptr)(T1, T2, T3, T4, T5, T6, T7, T8); function_ptr fp; fct_functor(function_ptr _fp) : fp(_fp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7, const typename clean::type& v8) const { return fp(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7), const_cast::type>(v8)); } }; template struct mtd_functor { typedef R return_type; static const bool is_void = false; typedef R (X::*method_ptr)(T1, T2, T3, T4, T5, T6, T7, T8); X* ip; method_ptr mp; mtd_functor(X* _ip, method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7, const typename clean::type& v8) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7), const_cast::type>(v8)); } }; template struct const_mtd_functor { typedef R (X::*const_method_ptr)(T1, T2, T3, T4, T5, T6, T7, T8) const; const X* ip; const_method_ptr mp; const_mtd_functor(const X* _ip, const_method_ptr _mp) : ip(_ip), mp(_mp) {} R operator() (const typename clean::type& v1, const typename clean::type& v2, const typename clean::type& v3, const typename clean::type& v4, const typename clean::type& v5, const typename clean::type& v6, const typename clean::type& v7, const typename clean::type& v8) const { return (ip->*mp)(const_cast::type>(v1), const_cast::type>(v2), const_cast::type>(v3), const_cast::type>(v4), const_cast::type>(v5), const_cast::type>(v6), const_cast::type>(v7), const_cast::type>(v8)); } }; /* expressions *******************************************************************/ namespace expression { struct tag {}; } template struct const_expression : public expression::tag { const T v; const_expression(const T& _v) : v(_v) {} const T operator() () { return v; } template const T operator() (const T1&) { return v; } template const T operator() (const T1&, const T2&) { return v; } template const T operator() (const T1&, const T2&, const T3&) { return v; } template const T operator() (const T1&, const T2&, const T3&, const T4&) { return v; } template const T operator() (const T1&, const T2&, const T3&, const T4&, const T5&) { return v; } template const T operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&) { return v; } template const T operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&) { return v; } template const T operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&) { return v; } }; template const_expression _c(const T& v) { return const_expression(v); } template struct ref_expression : public expression::tag { T& v; ref_expression(T& _v) : v(_v) {} T& operator() () { return v; } template T& operator() (const T1&) { return v; } template T& operator() (const T1&, const T2&) { return v; } template T& operator() (const T1&, const T2&, const T3&) { return v; } template T& operator() (const T1&, const T2&, const T3&, const T4&) { return v; } template T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&) { return v; } template T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&) { return v; } template T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&) { return v; } template T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&) { return v; } }; template ref_expression _r(T& v) { return ref_expression(v); } template struct const_ref_expression : public expression::tag { const T& v; const_ref_expression(const T& _v) : v(_v) {} const T& operator() () { return v; } template const T& operator() (const T1&) { return v; } template const T& operator() (const T1&, const T2&) { return v; } template const T& operator() (const T1&, const T2&, const T3&) { return v; } template const T& operator() (const T1&, const T2&, const T3&, const T4&) { return v; } template const T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&) { return v; } template const T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&) { return v; } template const T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&) { return v; } template const T& operator() (const T1&, const T2&, const T3&, const T4&, const T5&, const T6&, const T7&, const T8&) { return v; } }; template const_ref_expression _cr(const T& v) { return const_ref_expression(v); } template struct placeholder_expression; template <> struct placeholder_expression<1> : public expression::tag { void operator() () {} template const T1& operator() (const T1& v1) { return v1; } template const T1& operator() (const T1& v1, const T2& v2) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v1; } template const T1& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v1; } }; static placeholder_expression<1> _1; template <> struct placeholder_expression<2> : public expression::tag { void operator() () {} template void operator() (T1&) { } template const T2& operator() (const T1& v1, const T2& v2) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v2; } template const T2& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v2; } }; static placeholder_expression<2> _2; template <> struct placeholder_expression<3> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3) { return v3; } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return v3; } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return v3; } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v3; } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v3; } template const T3& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v3; } }; static placeholder_expression<3> _3; template <> struct placeholder_expression<4> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template void operator() (T1&, T2&, T3&) { } template const T4& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return v4; } template const T4& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return v4; } template const T4& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v4; } template const T4& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v4; } template const T4& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v4; } }; static placeholder_expression<4> _4; template <> struct placeholder_expression<5> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template void operator() (T1&, T2&, T3&) { } template void operator() (T1&, T2&, T3&, T4&) { } template const T5& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return v5; } template const T5& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v5; } template const T5& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v5; } template const T5& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v5; } }; static placeholder_expression<5> _5; template <> struct placeholder_expression<6> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template void operator() (T1&, T2&, T3&) { } template void operator() (T1&, T2&, T3&, T4&) { } template void operator() (T1&, T2&, T3&, T4&, T5&) { } template const T6& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return v6; } template const T6& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v6; } template const T6& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v6; } }; static placeholder_expression<6> _6; template <> struct placeholder_expression<7> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template void operator() (T1&, T2&, T3&) { } template void operator() (T1&, T2&, T3&, T4&) { } template void operator() (T1&, T2&, T3&, T4&, T5&) { } template void operator() (T1&, T2&, T3&, T4&, T5&, T6&) { } template const T7& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return v7; } template const T7& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v7; } }; static placeholder_expression<7> _7; template <> struct placeholder_expression<8> : public expression::tag { void operator() () {} template void operator() (T1&) { } template void operator() (T1&, T2&) { } template void operator() (T1&, T2&, T3&) { } template void operator() (T1&, T2&, T3&, T4&) { } template void operator() (T1&, T2&, T3&, T4&, T5&) { } template void operator() (T1&, T2&, T3&, T4&, T5&, T6&) { } template void operator() (T1&, T2&, T3&, T4&, T5&, T6&, T7&) { } template const T8& operator() (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return v8; } }; static placeholder_expression<8> _8; template struct is_expression { static const bool value = cgv::type::cond::is_base_of::value; }; template struct make_expression_type_impl { typedef const_expression type; }; template struct make_expression_type_impl { typedef T type; }; template struct make_expression_type { typedef typename make_expression_type_impl::value>::type type; }; template typename make_expression_type::type make_expression(const T& v) { return (typename make_expression_type::type)(v); } // rebinding structs ******************************************************************* template struct rebind0 { F functor; rebind0(const F& _functor) : functor(_functor) { } R operator () () { return functor(); } template R operator () (const T1& v1) { return functor( ); } template R operator () (const T1& v1, const T2& v2) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind0, R > rebind(X* x, R (X::*m_ptr)() ) { return rebind0, R >( mtd_functor(x, m_ptr) ); } template rebind0, R > rebind(const X* x, R (X::*m_ptr)() const ) { return rebind0, R >( const_mtd_functor(x, m_ptr) ); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments * \param arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind0, R > rebind(R (*f_ptr)() ) { return rebind0, R >( fct_functor(f_ptr) ); } template struct rebind1 { F functor; E1 e1; rebind1(const F& _functor, const E1& _e1) : functor(_functor), e1(_e1) { } R operator () () { return functor(e1()); } template R operator () (const T1& v1) { return functor( e1(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind1, R , typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1) , const A1& a1) { return rebind1, R , typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1)); } template rebind1, R , typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1) const , const A1& a1) { return rebind1, R , typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1 * \param A1 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind1, R , typename make_expression_type::type> rebind(R (*f_ptr)(T1) , const A1& a1) { return rebind1, R , typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1)); } template struct rebind2 { F functor; E1 e1; E2 e2; rebind2(const F& _functor, const E1& _e1, const E2& _e2) : functor(_functor), e1(_e1), e2(_e2) { } R operator () () { return functor(e1(), e2()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind2, R , typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2) , const A1& a1, const A2& a2) { return rebind2, R , typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2)); } template rebind2, R , typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2) const , const A1& a1, const A2& a2) { return rebind2, R , typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2 * \param A1,A2 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind2, R , typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2) , const A1& a1, const A2& a2) { return rebind2, R , typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2)); } template struct rebind3 { F functor; E1 e1; E2 e2; E3 e3; rebind3(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3) : functor(_functor), e1(_e1), e2(_e2), e3(_e3) { } R operator () () { return functor(e1(), e2(), e3()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3) , const A1& a1, const A2& a2, const A3& a3) { return rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3)); } template rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3) const , const A1& a1, const A2& a2, const A3& a3) { return rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3 * \param A1,A2,A3 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3) , const A1& a1, const A2& a2, const A3& a3) { return rebind3, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3)); } template struct rebind4 { F functor; E1 e1; E2 e2; E3 e3; E4 e4; rebind4(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3, const E4& _e4) : functor(_functor), e1(_e1), e2(_e2), e3(_e3), e4(_e4) { } R operator () () { return functor(e1(), e2(), e3(), e4()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1), e4(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2), e4(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3), e4(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4), e4(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5), e4(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6), e4(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7), e4(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8), e4(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3, T4) , const A1& a1, const A2& a2, const A3& a3, const A4& a4) { return rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4)); } template rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3, T4) const , const A1& a1, const A2& a2, const A3& a3, const A4& a4) { return rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3,T4 * \param A1,A2,A3,A4 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3, T4) , const A1& a1, const A2& a2, const A3& a3, const A4& a4) { return rebind4, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4)); } template struct rebind5 { F functor; E1 e1; E2 e2; E3 e3; E4 e4; E5 e5; rebind5(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3, const E4& _e4, const E5& _e5) : functor(_functor), e1(_e1), e2(_e2), e3(_e3), e4(_e4), e5(_e5) { } R operator () () { return functor(e1(), e2(), e3(), e4(), e5()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1), e4(v1), e5(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2), e4(v1, v2), e5(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3), e4(v1, v2, v3), e5(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4), e4(v1, v2, v3, v4), e5(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5), e4(v1, v2, v3, v4, v5), e5(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6), e4(v1, v2, v3, v4, v5, v6), e5(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7), e4(v1, v2, v3, v4, v5, v6, v7), e5(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8), e4(v1, v2, v3, v4, v5, v6, v7, v8), e5(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { return rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5)); } template rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5) const , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { return rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3,T4,T5 * \param A1,A2,A3,A4,A5 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3, T4, T5) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) { return rebind5, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5)); } template struct rebind6 { F functor; E1 e1; E2 e2; E3 e3; E4 e4; E5 e5; E6 e6; rebind6(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3, const E4& _e4, const E5& _e5, const E6& _e6) : functor(_functor), e1(_e1), e2(_e2), e3(_e3), e4(_e4), e5(_e5), e6(_e6) { } R operator () () { return functor(e1(), e2(), e3(), e4(), e5(), e6()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1), e4(v1), e5(v1), e6(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2), e4(v1, v2), e5(v1, v2), e6(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3), e4(v1, v2, v3), e5(v1, v2, v3), e6(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4), e4(v1, v2, v3, v4), e5(v1, v2, v3, v4), e6(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5), e4(v1, v2, v3, v4, v5), e5(v1, v2, v3, v4, v5), e6(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6), e4(v1, v2, v3, v4, v5, v6), e5(v1, v2, v3, v4, v5, v6), e6(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7), e4(v1, v2, v3, v4, v5, v6, v7), e5(v1, v2, v3, v4, v5, v6, v7), e6(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8), e4(v1, v2, v3, v4, v5, v6, v7, v8), e5(v1, v2, v3, v4, v5, v6, v7, v8), e6(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { return rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6)); } template rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6) const , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { return rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3,T4,T5,T6 * \param A1,A2,A3,A4,A5,A6 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3, T4, T5, T6) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) { return rebind6, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6)); } template struct rebind7 { F functor; E1 e1; E2 e2; E3 e3; E4 e4; E5 e5; E6 e6; E7 e7; rebind7(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3, const E4& _e4, const E5& _e5, const E6& _e6, const E7& _e7) : functor(_functor), e1(_e1), e2(_e2), e3(_e3), e4(_e4), e5(_e5), e6(_e6), e7(_e7) { } R operator () () { return functor(e1(), e2(), e3(), e4(), e5(), e6(), e7()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1), e4(v1), e5(v1), e6(v1), e7(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2), e4(v1, v2), e5(v1, v2), e6(v1, v2), e7(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3), e4(v1, v2, v3), e5(v1, v2, v3), e6(v1, v2, v3), e7(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4), e4(v1, v2, v3, v4), e5(v1, v2, v3, v4), e6(v1, v2, v3, v4), e7(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5), e4(v1, v2, v3, v4, v5), e5(v1, v2, v3, v4, v5), e6(v1, v2, v3, v4, v5), e7(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6), e4(v1, v2, v3, v4, v5, v6), e5(v1, v2, v3, v4, v5, v6), e6(v1, v2, v3, v4, v5, v6), e7(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7), e4(v1, v2, v3, v4, v5, v6, v7), e5(v1, v2, v3, v4, v5, v6, v7), e6(v1, v2, v3, v4, v5, v6, v7), e7(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8), e4(v1, v2, v3, v4, v5, v6, v7, v8), e5(v1, v2, v3, v4, v5, v6, v7, v8), e6(v1, v2, v3, v4, v5, v6, v7, v8), e7(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6, T7) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { return rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7)); } template rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6, T7) const , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { return rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3,T4,T5,T6,T7 * \param A1,A2,A3,A4,A5,A6,A7 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3, T4, T5, T6, T7) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7) { return rebind7, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7)); } template struct rebind8 { F functor; E1 e1; E2 e2; E3 e3; E4 e4; E5 e5; E6 e6; E7 e7; E8 e8; rebind8(const F& _functor, const E1& _e1, const E2& _e2, const E3& _e3, const E4& _e4, const E5& _e5, const E6& _e6, const E7& _e7, const E8& _e8) : functor(_functor), e1(_e1), e2(_e2), e3(_e3), e4(_e4), e5(_e5), e6(_e6), e7(_e7), e8(_e8) { } R operator () () { return functor(e1(), e2(), e3(), e4(), e5(), e6(), e7(), e8()); } template R operator () (const T1& v1) { return functor( e1(v1), e2(v1), e3(v1), e4(v1), e5(v1), e6(v1), e7(v1), e8(v1) ); } template R operator () (const T1& v1, const T2& v2) { return functor( e1(v1, v2), e2(v1, v2), e3(v1, v2), e4(v1, v2), e5(v1, v2), e6(v1, v2), e7(v1, v2), e8(v1, v2) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3) { return functor( e1(v1, v2, v3), e2(v1, v2, v3), e3(v1, v2, v3), e4(v1, v2, v3), e5(v1, v2, v3), e6(v1, v2, v3), e7(v1, v2, v3), e8(v1, v2, v3) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4) { return functor( e1(v1, v2, v3, v4), e2(v1, v2, v3, v4), e3(v1, v2, v3, v4), e4(v1, v2, v3, v4), e5(v1, v2, v3, v4), e6(v1, v2, v3, v4), e7(v1, v2, v3, v4), e8(v1, v2, v3, v4) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5) { return functor( e1(v1, v2, v3, v4, v5), e2(v1, v2, v3, v4, v5), e3(v1, v2, v3, v4, v5), e4(v1, v2, v3, v4, v5), e5(v1, v2, v3, v4, v5), e6(v1, v2, v3, v4, v5), e7(v1, v2, v3, v4, v5), e8(v1, v2, v3, v4, v5) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6) { return functor( e1(v1, v2, v3, v4, v5, v6), e2(v1, v2, v3, v4, v5, v6), e3(v1, v2, v3, v4, v5, v6), e4(v1, v2, v3, v4, v5, v6), e5(v1, v2, v3, v4, v5, v6), e6(v1, v2, v3, v4, v5, v6), e7(v1, v2, v3, v4, v5, v6), e8(v1, v2, v3, v4, v5, v6) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7) { return functor( e1(v1, v2, v3, v4, v5, v6, v7), e2(v1, v2, v3, v4, v5, v6, v7), e3(v1, v2, v3, v4, v5, v6, v7), e4(v1, v2, v3, v4, v5, v6, v7), e5(v1, v2, v3, v4, v5, v6, v7), e6(v1, v2, v3, v4, v5, v6, v7), e7(v1, v2, v3, v4, v5, v6, v7), e8(v1, v2, v3, v4, v5, v6, v7) ); } template R operator () (const T1& v1, const T2& v2, const T3& v3, const T4& v4, const T5& v5, const T6& v6, const T7& v7, const T8& v8) { return functor( e1(v1, v2, v3, v4, v5, v6, v7, v8), e2(v1, v2, v3, v4, v5, v6, v7, v8), e3(v1, v2, v3, v4, v5, v6, v7, v8), e4(v1, v2, v3, v4, v5, v6, v7, v8), e5(v1, v2, v3, v4, v5, v6, v7, v8), e6(v1, v2, v3, v4, v5, v6, v7, v8), e7(v1, v2, v3, v4, v5, v6, v7, v8), e8(v1, v2, v3, v4, v5, v6, v7, v8) ); } }; /* \brief rebind the arguments of a function to expressions. * \param inst_ptr pointer to an instance of type X * \param mtd_ptr pointer to a method with return type R and arguments T1, ..., Tn * \param A1, ..., An arguments that define the expressions to which the method parameters are bound * \return returns the result of method evaluation of type R * * No long description yet. */ template rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6, T7, T8) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { return rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7), make_expression(a8)); } template rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(const X* x, R (X::*m_ptr)(T1, T2, T3, T4, T5, T6, T7, T8) const , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { return rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( const_mtd_functor(x, m_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7), make_expression(a8)); } /* \brief rebind the arguments of a function to expressions. * \param fct_ptr pointer to a function with return type R and arguments T1,T2,T3,T4,T5,T6,T7,T8 * \param A1,A2,A3,A4,A5,A6,A7,A8 arguments that define the expressions to which the function parameters are bound * \return returns the result of function evaluation of type R */ template rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type> rebind(R (*f_ptr)(T1, T2, T3, T4, T5, T6, T7, T8) , const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6, const A7& a7, const A8& a8) { return rebind8, R , typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type, typename make_expression_type::type>( fct_functor(f_ptr) , make_expression(a1), make_expression(a2), make_expression(a3), make_expression(a4), make_expression(a5), make_expression(a6), make_expression(a7), make_expression(a8)); } } }