[英]ref() in Boost::Lambda?
What is the equivalent of Boost::Phoenix's ref
in Boost::Lambda? Boost :: Lambda中的Boost :: Phoenix
ref
相当于什么? I can't find it in the online docs. 我在在线文档中找不到它。
#include <algorithm>
#include <string>
#include <boost/lambda/bind.hpp>
using namespace boost::lambda;
int main()
{
std::string a, b;
std::for_each(b.begin(), b.end(), ref(a) += _1); // how do I do this?
}
boost::ref
and boost::lambda::var
don't seem to work (they don't have the operator overloads, apparently). boost::ref
和boost::lambda::var
似乎不起作用(它们显然没有运算符重载)。
D'oh, I just figured it out... 天哪,我只是想通了...
#include <boost/lambda/lambda.hpp>
and then var
will work! #include <boost/lambda/lambda.hpp>
,然后var
就可以了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.