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

最近任务多、工期紧,没有时间更新博客,就水一期吧。虽然是水,也不能太失水准,刚好最近工作中遇到一个 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.</rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></rt2></r></r></r></r></r></r></r></r></r></rt2></xxxxxxxxxxxxx></rt2></xxxxxxxxxxxxx></r>

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

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;
}</functional></iostream>

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

$ make
g++ -Wall -g -c bindemo.cpp -o bindemo.o -std=c++11
bindemo.cpp: In function &#x2018;int main(int, char**)&#x2019;:
bindemo.cpp:11:37: error: no matching function for call to &#x2018;bind(<unresolved overloaded function type>, int, int)&#x2019;
     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 &#x2018;_Func&#x2019;
     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, ... _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 &#x2018;_Result&#x2019;
     auto f1 = bind(create_task, 1, 2);
                                     ^
make: *** [bindemo.o] Error 1</_result,></class></typename></std::__or_<std::is_integral<typename></class></unresolved>

其实看了这个 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,这样再绑定就没有问题了。

---------------------- 20220625 更新 --------------------

其实网上关于这个问题的讨论已经很多了,只是通过出错信息直接搜的话很难命中,后来通过搜索 “bind + 函数重载” 得到一些新的方案 (不能加 boost,bing 坑我),主要分两种:

  • 强制转换
  • 模板参数

其实不管哪种方式,都是在 bind 无法区分重载函数的场景下,告诉 bind 我们要绑定的是哪个重载版本,区别只是形式不同。废话不多说,直接上代码:

auto f1 = bind((int (*)(int, int))create_task, 1, 2);

这是强制转换的方式,如果事先定义函数类型会更具可读性:

typedef int (*create_task_func)(int, int);
auto f1 = bind((create_task_func)create_task, 1, 2);

其实上面的过程是为了推导 bind 模板参数的类型,所以也可以一步到位,直接指明:

auto f1 = bind<create_task_func>(create_task, 1, 2);</create_task_func>

个人感觉这种方式可读性最好,推荐。

最后吐槽一下 boost 的错误信息,一次输出太多外还没有说到重点,没什么经验的人绝对头大,如果像标准 c++ 一样有 “unresolved overloaded function type” 这样友好的提示,我想应该不会走这么多的弯路,感谢评论区 同学的明眼指正~

---------------------- 20220625 更新 --------------------

问题虽然解决了,但是 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++ 标准滴~

Original: https://www.cnblogs.com/goodcitizen/p/boost_bind_choke_on_function_overload.html
Author: goodcitizen
Title: boost::bind 不能处理函数重载 (error: no matching function for call to ‘bind’)

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/577585/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • Linux常用指令笔记

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年8月24日
    0173
  • 数据库配置和前端项目创建

    1、封装Response utils.py/exception from rest_framework.response import Response class APIResp…

    Linux 2023年6月14日
    065
  • linux平台下防火墙iptables原理(转)

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年8月11日
    0316
  • IaaS、PaaS和SaaS:云计算的三种服务模式 【转】

    云计算是一种新的计算资源使用模式,云端本身还是 IT 系统,所以逻辑上同样可以划分为这四层。底三层可以再划分出很多”小块”并出租出去,这有点像立体停车房,按…

    Linux 2023年6月8日
    075
  • 会计学包含的两种程序设计思想

    下班路上坐地铁的时候看了一本会计学的书,目前看了50多页。过程中,发现会计学和程序设计在思想上有惊人的相似之处。今天举两个例子做说明。 CR设计和账簿 CR设计介绍 CR设计就是只…

    Linux 2023年6月14日
    056
  • LeetCode-16. 最接近的三数之和

    题目来源 题目详情 给你一个长度为 n 的整数数组 nums和 一个目标值 target。请你从 nums 中选出三个整数,使它们的和与 target 最接近。 返回这三个数的和。…

    Linux 2023年6月7日
    076
  • 文件权限问题导致plink报错 Failed to open 21JAN.log. Try changing the –out parameter.

    晚上起来,想想一直没有解决的问题,所以复制一个目录,开始运行数据,但到了第一步就挖坑 [En] Rise in the evening, think of the problems…

    Linux 2023年5月27日
    049
  • 在Visual Studio 中使用git——标记(Tag)管理(十)

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年8月30日
    0238
  • Linux 配置 IPv4或 IPv6地址

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年10月15日
    0214
  • mac 打不开也连接不了github

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年8月30日
    0257
  • QNAP container station安装 redis

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年9月14日
    0228
  • git 常见错误及处理

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年8月30日
    0237
  • Linux i3 用户手册(简要)

    i3 用户手册 与(mod一起使用的键 一般为Win键或为Alt键, 可以和与 Shift+\)mod 一起使用 按键参考图 红色键是您需要按下的修饰符(默认情况下),蓝色键是您的…

    Linux 2023年6月7日
    049
  • 保姆教程系列一、Linux搭建Nacos

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年11月8日
    0179
  • Linux基础学习(二)

    显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录 [root@ct7 ~]# ls /etc | grep -E “^[0-9][a-z]*”…

    Linux 2023年6月8日
    057
  • Redis16个常见使用场景

    注入产生的原理: 数据库设置为GBK编码: 宽字节注入源于程序员设置MySQL连接时错误配置为:set character_set_client=gbk,这样配置会引发编码转换从而…

    Linux 2022年9月14日
    0212
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球