阅读背景:

哪种编译器适用于以下重载/特化行为?

来源:互联网 

Consider the following code:

请考虑以下代码:

#include <stdio.h>

namespace Foo {
  template <typename T>
  void foo(T *, int) { puts("T"); }

  template <typename T>
  struct foo_fun {
    static void fun() { foo((T *)0, 0); };
  };
}

namespace Foo {
  void foo(int *, int) { puts("int"); }
}

using namespace Foo;

int main() {
  foo_fun<int> fun;
  fun.fun();
}
#incl



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: