Advertisement
Guest User

Three compilers disagree

a guest
Mar 8th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. template <class A, class B> struct Foo {
  4.     template <class Z>
  5.     void operator-(Z z) const { std::cout << "Member\n"; }
  6. };
  7.  
  8. template <class A, class Z> void operator- (const Foo<A, int>& foo, Z z)  {
  9.     std::cout << "Standalone\n";
  10. }
  11.  
  12. int main () {
  13.     Foo<double, int> x;
  14.     x-2;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement