我想将类型 T 的 vector 转换为类型 K 的 vector 。 我试过这个,但它不起作用:
transform(vec.rbegin(),vec.rend(),vecNew.begin(),boost::bind(static_cast<K>(),_1));
我收到错误:“在‘)’标记之前需要主表达式”。我做错了什么?
最佳答案
使用 boost cast 仿函数 ll_static_cast<K>()
关于c++ - 将 static_cast 与 boost::bind 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3430152/