boost 1.53的lambda中没法调用大于4的placeholder
boost 1.53的lambda中无法调用大于4的placeholder
我在vs2008环境使用boost 1.53的lambda库。
我遇到一个问题:
在使用boost::lambda时,编译器找不到_4、_5、_6、_7、_8、_9,即在lambda命名空间内只能找到编号不大于3的placeholder。而boost::bind库却可以使用9个placeholder。
我试过清空重新编译、建立其他工程编译,都不行。
假设函数fun5接受5个int的参数。
如果写:
会报:
error C2065: “_4”: 未声明的标识符
如果写:
会报:
error C2039: “_4”: 不是“boost::lambda”的成员
是不是lambda库支持3个参数?
还是我的其他什么配置的问题?
------解决方案--------------------
是只有3个.
------解决方案--------------------
http://www.boost.org/doc/libs/1_53_0/doc/html/lambda/le_in_details.html#lambda.placeholders
我在vs2008环境使用boost 1.53的lambda库。
我遇到一个问题:
在使用boost::lambda时,编译器找不到_4、_5、_6、_7、_8、_9,即在lambda命名空间内只能找到编号不大于3的placeholder。而boost::bind库却可以使用9个placeholder。
我试过清空重新编译、建立其他工程编译,都不行。
假设函数fun5接受5个int的参数。
如果写:
using namespace boost::lambda;
function<int(int,int,int,int,int)> f=bind(fun5,999,_1,_2,_3,_4);
会报:
error C2065: “_4”: 未声明的标识符
如果写:
using namespace boost;
function<int(int,int,int,int,int)> f=bind(fun5,999,lambda::_1,lambda::_2,lambda::_3,lambda::_4);
会报:
error C2039: “_4”: 不是“boost::lambda”的成员
是不是lambda库支持3个参数?
还是我的其他什么配置的问题?
lambda
Boost
placeholder
------解决方案--------------------
是只有3个.
------解决方案--------------------
http://www.boost.org/doc/libs/1_53_0/doc/html/lambda/le_in_details.html#lambda.placeholders