On 8/20/05, jll@soundobjectlogic.com
Hello,
I'm just discovering Boost, and it looks great. However, I can't get the following code to work. I use g++ (GCC) 3.4.4 20050721 and boost 1.32 (also tried 1.33). When I try a similar example with mere integers it works though...
#include <string> #include <sstream> #include <iterator> #include <vector> #include
#include using namespace std; using namespace boost::lambda;
int main() { vector<string> cols; cols.push_back("foo"); string prefix = "t1."; for_each(cols.begin(), cols.end(), _1 = prefix + _1); cout << cols.front() << endl; return 0; }
<snip errors>
-- Jean-Louis Leroy Sound Object Logic http://www.soundobjectlogic.com
The easiest way I've found is to override the operator+ return type, i.e. change your lambda expression to: _1 = ret<string>(prefix + _1) Stuart Dootson