On 29/01/2014 07:09 p.m., Chris Stankevitz wrote:
Can you tell me why the following code fails to compile? It smells as if udp.hpp is causing MSVC to "using namespace std".
MSVC is doing some kind of weird argument dependent lookup.
PS: It doesn't happen if I remove the asio include.
That is because <functional> gets included by it. Include it directly and you should get the same error.
PPS: It doesn't happen if g() takes int vs std::string.
That is because `string` is in the `std` namespace. Change it to anything else in the `std` namespace and you should get the same error.
PPPS: It doesn't happen on GCC
This is because it's a MSVC bug. I cannot reproduce it in VS2013, so I guess they fixed it.
#include
#include #include <string> using boost::bind;
void g(const std::string&) { }
int main() { bind(g, _1); return 0; }
Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com