bind2nd使用
首先要继承binary_function类,而自定义的函数对象必须是常函数?
template<classF,classT>
std::binder2nd<F>bind2nd(constF&f,constT&x);
从定义看接收的函数对象是常对象,所以要写成常函数。less<T>()也是常函数
template<class T>
class A :public binary_function<T,...
原创
2021-08-04 13:08:35 ·
240 阅读 ·
0 评论