[range] Conflict with string algorithms

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[range] Conflict with string algorithms

Boost - Users mailing list
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);
}


Is this intentional or is it is an oversight or am I just doing
something wrong?


--
Bill


_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: [range] Conflict with string algorithms

Boost - Users mailing list
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 mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users