当前位置 : 主页 > 编程语言 > 其它开发 >

boost::bind 不能处理函数重载 (error: no matching function for call to 'bind')

来源:互联网 收集:自由互联 发布时间:2022-05-31
项目开发中遇到的一个问题,c++ 虐我千万遍,我待 c++ 如初恋… 前言 最近任务多、工期紧,没有时间更新博客,就水一期吧。虽然是水,也不能太失水准,刚好最近工作中遇到一个
项目开发中遇到的一个问题,c++ 虐我千万遍,我待 c++ 如初恋… 前言

最近任务多、工期紧,没有时间更新博客,就水一期吧。虽然是水,也不能太失水准,刚好最近工作中遇到一个 boost::bind 的问题,花费了半天时间来定位解决,就说说它吧。

问题背景

项目中使用了 boost 的 ios_service,任务都是 post 到对应线程去执行,这样可以避免复杂的多线程同步问题,有点类似早年间 COM 的单线程套间模型。不过这就需要将接口通过 bind 封装为函数对象传递给 ios_service,之前的代码都工作正常,但我新增了一个接口后,却怎么也编译不过,报下面的错误 (超长内容,展开谨慎):

查看代码
jni/../../Task/jni/../jni/../../xxxx/jni/../xxxx_xxxxxxxxx.cpp:3414:48: error: no matching function for call to 'bind'
        xxxxxxxxxxx::instance()->getIOS().post(boost::bind(&xxxxxxxxxxxxx::create_task, 
                                               ^~~~~~~~~~~
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1907:5: note: candidate template ignored: couldn't infer template argument 'R'
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1981:5: note: candidate template ignored: couldn't infer template argument 'R'
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2073:5: note: candidate template ignored: couldn't infer template argument 'F'
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:57:5: note: candidate template ignored: couldn't infer template argument 'R'
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:161:5: note: candidate template ignored: couldn't infer template argument
      'R'
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:172:5: note: candidate template ignored: couldn't infer template argument
      'R'
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:184:13: note: candidate template ignored: couldn't infer template argument
      'Rt2'
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:196:13: note: candidate template ignored: couldn't infer template argument
      'Rt2'
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:68:5: note: candidate template ignored: could not match
      'R (T::*)(B1, B2)' against 'boost::shared_ptr<xxxxxxxxxxxxx>'
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:79:5: note: candidate template ignored: could not match
      'R (T::*)(B1, B2) const' against 'boost::shared_ptr<xxxxxxxxxxxxx>'
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1875:5: note: candidate function template not viable: requires single argument
      'f', but 5 arguments were provided
    BOOST_BIND(F f)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1883:5: note: candidate function template not viable: requires 2 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1891:5: note: candidate function template not viable: requires 3 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1899:5: note: candidate function template not viable: requires 4 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1915:5: note: candidate function template not viable: requires 6 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1923:5: note: candidate function template not viable: requires 7 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1931:5: note: candidate function template not viable: requires 8 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1939:5: note: candidate function template not viable: requires 9 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1947:5: note: candidate function template not viable: requires 10 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1957:5: note: candidate function template not viable: requires 2 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1965:5: note: candidate function template not viable: requires 3 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1973:5: note: candidate function template not viable: requires 4 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1989:5: note: candidate function template not viable: requires 6 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1997:5: note: candidate function template not viable: requires 7 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2005:5: note: candidate function template not viable: requires 8 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2013:5: note: candidate function template not viable: requires 9 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2021:5: note: candidate function template not viable: requires 10 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2029:5: note: candidate function template not viable: requires 11 arguments, but
      5 were provided
    BOOST_BIND(boost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2041:5: note: candidate function template not viable: requires single argument
      'f', but 5 arguments were provided
    BOOST_BIND(F f)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2049:5: note: candidate function template not viable: requires 2 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2057:5: note: candidate function template not viable: requires 3 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2065:5: note: candidate function template not viable: requires 4 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2081:5: note: candidate function template not viable: requires 6 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2089:5: note: candidate function template not viable: requires 7 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2097:5: note: candidate function template not viable: requires 8 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2105:5: note: candidate function template not viable: requires 9 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2113:5: note: candidate function template not viable: requires 10 arguments, but
      5 were provided
    BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:17:5: note: candidate function template not viable: requires single argument
      'f', but 5 arguments were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) () BOOST_BIND_NOEXCEPT)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:26:5: note: candidate function template not viable: requires 2 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1) BOOST_BIND_NOEXCEPT, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:35:5: note: candidate function template not viable: requires 3 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:46:5: note: candidate function template not viable: requires 4 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:68:5: note: candidate function template not viable: requires 6 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:79:5: note: candidate function template not viable: requires 7 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:90:5: note: candidate function template not viable: requires 8 arguments, but
      5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:101:5: note: candidate function template not viable: requires 9 arguments,
      but 5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, ...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_cc.hpp:112:5: note: candidate function template not viable: requires 10 arguments,
      but 5 were provided
    BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9) BOOST_BIND_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 ...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:20:5: note: candidate function template not viable: requires 2 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:30:5: note: candidate function template not viable: requires 2 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:41:13: note: candidate function template not viable: requires 2 arguments,
      but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () BOOST_BIND_MF_NOEXCEPT, A1 a1)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:52:13: note: candidate function template not viable: requires 2 arguments,
      but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const BOOST_BIND_MF_NOEXCEPT, A1 a1)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:65:5: note: candidate function template not viable: requires 3 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:76:5: note: candidate function template not viable: requires 3 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:88:13: note: candidate function template not viable: requires 3 arguments,
      but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:100:13: note: candidate function template not viable: requires 3
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:113:5: note: candidate function template not viable: requires 4 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:124:5: note: candidate function template not viable: requires 4 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:136:13: note: candidate function template not viable: requires 4
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:148:13: note: candidate function template not viable: requires 4
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:209:5: note: candidate function template not viable: requires 6 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:220:5: note: candidate function template not viable: requires 6 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:232:13: note: candidate function template not viable: requires 6
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:244:13: note: candidate function template not viable: requires 6
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:257:5: note: candidate function template not viable: requires 7 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:268:5: note: candidate function template not viable: requires 7 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:280:13: note: candidate function template not viable: requires 7
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:292:13: note: candidate function template not viable: requires 7
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:305:5: note: candidate function template not viable: requires 8 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:316:5: note: candidate function template not viable: requires 8 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:328:13: note: candidate function template not viable: requires 8
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:340:13: note: candidate function template not viable: requires 8
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:353:5: note: candidate function template not viable: requires 9 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:364:5: note: candidate function template not viable: requires 9 arguments,
      but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 ...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:376:13: note: candidate function template not viable: requires 9
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A...
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:388:13: note: candidate function template not viable: requires 9
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A...
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:401:5: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:412:5: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:424:13: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a...
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf_cc.hpp:436:13: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    >::type BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const BOOST_BIND_MF_NOEXCEPT, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5...
            ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:21:5: note: candidate function template not viable: requires 3 arguments,
      but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:31:5: note: candidate function template not viable: requires 3 arguments,
      but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:44:5: note: candidate function template not viable: requires 4 arguments,
      but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:55:5: note: candidate function template not viable: requires 4 arguments,
      but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:92:5: note: candidate function template not viable: requires 6 arguments,
      but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:103:5: note: candidate function template not viable: requires 6
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:116:5: note: candidate function template not viable: requires 7
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:127:5: note: candidate function template not viable: requires 7
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:140:5: note: candidate function template not viable: requires 8
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:151:5: note: candidate function template not viable: requires 8
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:164:5: note: candidate function template not viable: requires 9
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:175:5: note: candidate function template not viable: requires 9
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:188:5: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:199:5: note: candidate function template not viable: requires 10
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:212:5: note: candidate function template not viable: requires 11
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 ...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind_mf2_cc.hpp:223:5: note: candidate function template not viable: requires 11
      arguments, but 5 were provided
    BOOST_BIND(boost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a...
    ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:2342:1: note: candidate function template not viable: requires 2 arguments, but
      5 were provided
BOOST_BIND( M T::*f, A1 a1 )
^
jni/../../Task/jni/../../../third-party/boost/include/boost/bind/bind.hpp:1868:20: note: expanded from macro 'BOOST_BIND'
#define BOOST_BIND bind
                   ^
1 error generated.

错误看着挺唬人,其实关键的就是第一句:

jni/../../Task/jni/../jni/../../xxxx/jni/../xxxx_xxxxxxxxx.cpp:3414:48: error: no matching function for call to 'bind'
        xxxxxxxxxxx::instance()->getIOS().post(boost::bind(&xxxxxxxxxxxxx::create_task, 
                                               ^~~~~~~~~~~

boost::bind create_task 这个接口时出错了,百度了下这个错误,网上比较多的说法是 bind 给的参数和接口声明不一致,可是仔细检查了三遍参数,都没有发现问题,甚至把 post 改成直接调用的形式,这个就可以通过编译,真是神了~

另外查资料的过程中,发现 bind 最多支持 9 个参数,超过就不行了。不过在我的场景里,只有 4 个参数,所以也不是这方面的问题,可以排除。

排查过程

为了简化问题的排查过程,排除其它因素干扰,我写了一个简单例子:

#include <iostream>
#include <functional> 

using namespace std; 

int create_task(int);
int create_task(int, int);

int main(int argc, char* argv[])
{
    auto f1 = bind(create_task, 1, 2); 
    f1(); 
    return 0; 
}

int create_task(int a)
{
    cout << "create_task (" << a << ") called" << endl; 
    return 0; 
} 

int create_task(int a, int b)
{
    cout << "create_task (" << a << ", " << b << ") called" << endl; 
    return 0; 
}

 这里使用了 std bind 而不是 boost bind,不过一样可以复现出错场景,同时避免引入 boost 静态库导致 demo 太过复杂:

$ make
g++ -Wall -g -c bindemo.cpp -o bindemo.o -std=c++11
bindemo.cpp: In function ‘int main(int, char**)’:
bindemo.cpp:11:37: error: no matching function for call to ‘bind(<unresolved overloaded function type>, int, int)’
     auto f1 = bind(create_task, 1, 2); 
                                     ^
bindemo.cpp:11:37: note: candidates are:
In file included from bindemo.cpp:2:0:
/usr/include/c++/4.8.2/functional:1655:5: note: template<class _Func, class ... _BoundArgs> typename std::_Bind_helper<std::__or_<std::is_integral<typename std::decay<_Tp>::type>, std::is_enum<typename std::decay<_Tp>::type> >::value, _Func, _BoundArgs ...>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/usr/include/c++/4.8.2/functional:1655:5: note:   template argument deduction/substitution failed:
bindemo.cpp:11:37: note:   couldn't deduce template parameter ‘_Func’
     auto f1 = bind(create_task, 1, 2); 
                                     ^
In file included from bindemo.cpp:2:0:
/usr/include/c++/4.8.2/functional:1682:5: note: template<class _Result, class _Func, class ... _BoundArgs> typename std::_Bindres_helper<_Result, _Func, _BoundArgs>::type std::bind(_Func&&, _BoundArgs&& ...)
     bind(_Func&& __f, _BoundArgs&&... __args)
     ^
/usr/include/c++/4.8.2/functional:1682:5: note:   template argument deduction/substitution failed:
bindemo.cpp:11:37: note:   couldn't deduce template parameter ‘_Result’
     auto f1 = bind(create_task, 1, 2); 
                                     ^
make: *** [bindemo.o] Error 1

其实看了这个 demo,很多人都会怀疑一个问题——是不是重载的 create_task 出了问题呢?确实如此,其实我只要将另一个 create_task 的声明注释掉 (实现仍保留),这个 demo 就可以编译通过了,运行效果如下:

$ ./bindemo
create_task (1, 2) called

不过我在当初查这个问题的时候可是费了九牛二虎之力,因为参数使用了引用类型,一开始怀疑是引用的锅,直接使用指针,不行;然后怀疑是没有为引用参数添加 boost::ref,也不行;最后直接把 bind 接口改成另外一个成员函数 (start_task),无意中居然通过了。不过此时我仍怀疑是参数的问题,于是增加了一个同名的函数重载,参数照抄 create_task,结果就失败了;最神奇的是改为之前那版 start_task 也不行了,这才开始怀疑是函数重载的问题。

解决方案

知道了问题原因,改起来就比较顺了,因为新版的 create_task 增加了一个结构体作为参数,于是干脆将它重命名为 create_task_param,这样再绑定就没有问题了。

后记

问题虽然解决了,但是 bind 为何对重载函数如此“无能为力”呢?按理说根据提供给 bind 的参数,再匹配重载函数的参数列表,应该可以挑选正确的重载版本。

不过换个角度思考,bind 支持占位符,上面的例子中,我可以这样写:

int main(int argc, char* argv[])
{
    auto f1 = bind(create_task, 1, 2); 
    f1(); 
    auto f2 = bind(create_task, placeholders::_1, 0); 
    f2(3); 
    return 0; 
}

其中 f2 有一个参数使用了占位符,这个参数将在调用时才传递,而 bind 需要在绑定那一刻知道使用的是哪个版本的 create_task,针对这个例子,他只有一个两参数的版本可选,但如果有多个两参数且第二参数为 int 类型的重载版本的话,bind 就迷糊了,毕竟他不知道后面用户会给占位符传递什么类型的参数不是?所以我猜测为了避免类似的问题,c++ 干脆不让 bind 支持重载函数,直接出错了事,编译期错误总比运行期错误好解决,你觉得呢?

当然,比较迷的是,这里只有一个两参数的版本,bind 仍然报错了,这是够懒的。另外有些网上的文章说 (附录 4),bind 会挑选重载函数中第一个声明的版本,如果通过就通过,如果不通过就报错。但是我实际测试的情况是,无论将两参数的版本放在前面还是后面,都报错,除非不声明,看起来我这个 gcc 版本是严格执行了 c++ 标准滴~

参考

[1]. boost::bind对引用的特殊处理_hacker_lpy的博客-CSDN博客

[2]. Boost::bind使用详解 - jackjoe - 自由互联

[3]. 关于std::function和std::bind绑定成员函数

[4]. boost::bind with overloaded functions?

[5]. 使用boost::bind和重载函数的访客模式

【文章转自:韩国站群服务器 http://www.558idc.com/krzq.html 欢迎留下您的宝贵建议】
网友评论