vector iterator element-wise operation

I'm using this example: http://stackoverflow.com/questions/773667/element-wise-operations-with-boost... and for some reason the function std::fill compiles and works just fine, but functions std::for_each and std::transform do no compile - saying that there is no compatible function found for the iterator type. using namespace boost::numeric::ublas; // Create a 30 element vector of doubles vector<double> vec(30); // Assign 8.0 to each element. std::fill(vec.begin(), vec.end(), 8.0); // Perform the "Gamma" function on each element and assign the result back // to the original element in the vector. // The next line does not compile, but the fill function compiles and executes just fine: std::transform(vec.begin(), vec.end(), vec.begin(), boost::math::tgamma); What's wrong? Cheers, Max
participants (1)
-
Max S. Kaznady