这不会为我编译:
int i = 1;
std::function<void(std::vector<int>&)> execute = std::bind(append<int>, _1, std::ref(i));
append 有签名的地方:
template<class T>
void append(std::vector<T>& container, const T& valueToAppend)
我做错了什么很明显吗?
编译器错误是:
error C2664: 'void (std::vector<_Ty> &,const T &)' : cannot convert parameter 1 from 'boost::arg<I>' to 'std::vector<_Ty> &'
1> with
1> [
1> _Ty=int,
1> T=int
1> ]
1> and
1> [
1> I=1
1> ]
1> and
1> [
1> _Ty=int
1> ]