|
Boost Users : |
Subject: Re: [Boost-users] reference to _1 is ambiguous
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-03-18 04:31:13
Sandeep Gupta wrote:
> Hi,
> This problem has appeared before on the list but in a different
> context. The following code
>
>
> std::vector<int> myvec;
> for_each(myvec, std::cout<<_1<<' ');
>
> gives the error:
>
> Serializer.h:78: error: reference to _1 is ambiguous
> /home/sandeep/Computing/boost_1_38_0/boost/lambda/core.hpp:69: error:
> candidates are: const boost::lambda::placeholder1_type&
> boost::lambda::<unnamed>::_1
> /home/sandeep/Computing/boost_1_38_0/boost/bind/placeholders.hpp:54:
> error: boost::arg<1> <unnamed>::_1
> Serializer.h:78: error: reference to _1 is ambiguous
>
>
> I believe boost/bind is getting included indirectly via some other
> library. I have tried several modification but none seem to work as I
> was quite reluctant to post a third mail on the list.
Disregaring the bind inclusion part, what about:
for_each(myvec, std::cout << ::boost::lambda::_1 << ' ');
/ Johan
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