我在 Boost 的线程中使用 lambda 时遇到问题。
该代码应该将函数(字符串)的结果放在向量的指定索引中。
std::vector< string > results(size);
std::vector< boost::thread > threads;
for( int i = 0; i < size; i++ ) {
threads.push_back( boost::thread( results.at( i ) = getAString( x,y,zed ) ) );
}
我将如何在这里使用 Boost::lambda ?
请不要提及使用 c++11 语法。我被迫使用的系统不支持支持 c++11 的编译器。谢谢!