$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [lambda] newbie: lambda to help in std::accumulate
From: Micha³ Nowotka (mmmnow_at_[hidden])
Date: 2009-01-25 08:20:17
I want to compute sum of logarithms so i wrote:
#include <cmath>
double evaluate(const vector<double>& win_probabls)
{
return accumulate (win_probabls.begin(), win_probabls.end(), 0,
lambda::_1 + log(lambda::_2) );
}
but this code doesn't compile. Does anyone know why?
-- Micha³ Nowotka