C++ std :: bind to std :: function,VS2015出了什么问题?

Can*_*ini 0 c++ stl c++11 visual-studio-2013 visual-studio-2015

我是VS2013的用户,我经常使用如下的初始化,它就像一个魅力:

MyClass::MyClass myRoutine(){
    std::function<double(double)> oFunc = std::bind(&Myclass::myfunction, this, std::placeholders::_1);
}

MyClass::MyClass myfunction(double & inX){
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

我决定升级到VS2015,但编译器报告错误:

错误C2440:'初始化':无法从'std :: _ Binder <std :: _ Unforced,double(__ thiscall MyClass ::*)(double&),MyClass*const,const std :: _ Ph <1>&>'转换为'std :: function <double(double)>'

发生了什么?

Max*_*kin 5

功能签名不匹配:double(double)vs double(double&).因此编译错误.其中一个需要改变,例如:

double MyClass::myfunction(double inX){
    return 0;
}
Run Code Online (Sandbox Code Playgroud)