lamba: QStringList <<

Hello,
the following for_each call with _1 fails to compile
#include

AMDG Hicham Mouline wrote:
the following for_each call with _1 fails to compile
#include
#include using namespace boost::lambda; QStringList items_list; std::for_each(begin_items(),end_items(), items_list << _1 ); QStringList has these << operators defined: QStringList& operator<< ( const QString& str ); QStringList& operator<< ( const QStringList& other );
<snip>
You need to use var(items_list). Remember that Boost.Lambda captures arguments by value. In Christ, Steven Watanabe
participants (2)
-
Hicham Mouline
-
Steven Watanabe