10 May
2008
10 May
'08
4:12 p.m.
AMDG Ken Smith wrote:
Here is the code.
1 #include
2 #include 3 #if defined(INCLUDE_BOOST_BIND) 4 # include 5 #endif 6 #include <iostream> 7 #include <iterator> 8 #include <algorithm> 30 31 int main() 32 { 33 using namespace std; 34 using namespace boost::lambda; 35 36 typedef std::istream_iterator<int> in; 37 std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " ); 76 } Any ideas?
Boost.Bind declares the placeholders _1, _2, etc at global scope. Boost.Lambda declares the placeholders _1, _2, and _3 in namespace boost::lambda. The use of _1 in this context is ambiguous. Try qualifying it. namespace bll = boost::lambda; (bll::_1 * 3) In Christ, Steven Watanabe