Boost logo

Boost Users :

Subject: Re: [Boost-users] [range] Conflict with string algorithms
From: Gavin Lambert (boost_at_[hidden])
Date: 2019-03-29 03:50:42


On 29/03/2019 08:00, Bill Buklis wrote:
> I noticed there is a conflict between boost range and the string
> algorithm header files. There may be others, but the specific one I was
> dealing with was boost::find.
>
> For example, the following code results in an ambiguous warning. This is
> because boost::find is defined both in algorithm/string/find.hpp and
> range/algorithm/find.hpp.
>
> #include <vector>
> #include <boost/range/algorithm.hpp>
> #include <boost/algorithm/string.hpp>
>
> int main()
> {
>     std::vector<int>    vec;
>     boost::find(vec, 3);
> }

You can disambiguate it by using boost::range::find or
boost::algorithm::find instead.


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