|
Boost Users : |
Subject: [Boost-users] [lambda] problem with g++
From: Micha³ Nowotka (mmmnow_at_[hidden])
Date: 2009-03-20 16:37:19
following code does not compile with g++ while under vs2008 it works fine:
//window.h
///(...)
class Window
{
//(...)
protected:
//(...)
double evaluate(const vector<double>& win_probabls) const;
//(...)
}
//(...)
//window.cpp
#include "window.h"
#include <boost/lambda/lambda.hpp>
#include <boost/lambda/bind.hpp>
#include <algorithm>
#include <numeric>
#include <cmath>
//(...)
double Window::evaluate(const vector<double>& win_probabls) const
{
return accumulate (win_probabls.begin(), win_probabls.end(), 0.0,
lambda::_1 + lambda::bind(log, lambda::_2) );
}
//(...)
g++ returns following error:
src/window.cpp:92: error: no matching function for call to
'bind(<unresolved overloaded function type>, const
boost::lambda::lambda_functor<boost::lambda::placeholder<2> >&)'
make: *** [build/window.o] Error 1
and I don't know what shuld I change to make it work for me...
-- Regards Micha³ Nowotka
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net