#include <iostream>
#include <algorithm>
namespace foo
{
struct Bar
{
int data;
};
void init(Bar& bar)
{
bar.data = 42;
}
}
void init(foo::Bar& bar)
{
bar.data = 777;
}
int main()
{
foo::Bar bar;
init(bar) // Error! call of overloaded 'init(foo::Bar&)' is ambiguous.
std::cout << bar.data << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgoKbmFtZXNwYWNlIGZvbwp7CiAgICBzdHJ1Y3QgQmFyCiAgICB7CiAgICAgICAgaW50IGRhdGE7CiAgICB9OwogICAgCiAgICB2b2lkIGluaXQoQmFyJiBiYXIpCiAgICB7CiAgICAgICAgYmFyLmRhdGEgPSA0MjsKICAgIH0KfQoKdm9pZCBpbml0KGZvbzo6QmFyJiBiYXIpCnsKICAgIGJhci5kYXRhID0gNzc3Owp9CgppbnQgbWFpbigpCnsKICAgIGZvbzo6QmFyIGJhcjsKICAgIGluaXQoYmFyKSAvLyBFcnJvciEgY2FsbCBvZiBvdmVybG9hZGVkICdpbml0KGZvbzo6QmFyJiknIGlzIGFtYmlndW91cy4KICAgIAogICAgc3RkOjpjb3V0IDw8IGJhci5kYXRhIDw8IHN0ZDo6ZW5kbDsKICAgIAogICAgcmV0dXJuIDA7Cn0=