[range] Conflict with string algorithms

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

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.
participants (2)
-
Bill Buklis
-
Gavin Lambert