Skip to content

Instantly share code, notes, and snippets.

@qsorix
Created November 10, 2010 14:50
Show Gist options
  • Save qsorix/670940 to your computer and use it in GitHub Desktop.
Save qsorix/670940 to your computer and use it in GitHub Desktop.
#include <iostream>
namespace ns1 {
template <typename T, typename U>
int operator+(const T&, const U&)
{
std::cout << "ns1::operator+" << std::endl;
return 1;
}
namespace ns1_1 {
using ns1::operator+;
struct foo {
};
}
namespace ns1_2 {
struct bar {};
bar operator+(const bar&, const bar&)
{
std::cout << "ns1_2::operator+" << std::endl;
}
int function()
{
ns1_1::foo a, b;
a + b;
}
}
}
int main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment