Thanks!S.C. Leung
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi!I have downloaded Range.Ex uploaded at 26.04.2009 09:09. It seems the difficulties are still there.
009/7/3 Neil Groves <ne...@grovescomputing.com>
Hello!On Fri, Jul 3, 2009 at 2:38 AM, 梁绍池 <shaoch...@gmail.com> wrote:
I use vc 9.0 to compile the following code with boost 1.39.0 and range_ex.#include<string>#include<boost/algorithm/string.hpp>#include<boost/range/algorithm.hpp>int main() {std::string s = "hello";boost::find_first(s, "lo");return 0;}
The compiler will complain ambiguous call to overload function "find". I found there's also a "find" in boost/range/algorithm.hpp. Even worse when I change the type of "s" to const std::string, the compiler will resolute "find" call as the one in boost/range/algorithm.hppand reports an error "const_iterator is not a member of std::_String_const_iterator". Now I just indicated the "find" call in boost::find_first explicitly. Is there a better way to solve it?
I think the problem might be related to ADL. All boost libraries should
guard against this. For example, in the string library, forwarding calls
should be to
boost::algorithm::foo
and also in the range library, forwarding calls should use
boost::ranges::foo
-Thorsten
Hello, Thorsten:Have you test my case and had the same problem with me? Does it mean that the library should call the function explicitly?
Thanks!S.C. Leung
No, where can I get the patch. Is it in the range_ex.zip?
The patch of <boost/algorithm/string/find.hpp> did work.Then what's the conclusion? Could anyone reproduce my difficulty? Or it is just my missing something when using find_first with "boost/range/algorithm.hpp"?