template13.c

来自「俄罗斯高人Mamaich的Pocket gcc编译器(运行在PocketPC上)」· C语言 代码 · 共 24 行

C
24
字号
// Build don't link:// Templates defined outside must be declared inside// crash test - XFAIL *-*-*namespace bar{  template<class T>  void foo(); // trick it to provide some prior declaration  template<class T>class X; // ERROR - previous declaration}template <typename T>T constbar::foo(T const &a)    {                        // ERROR - not declared in bar - XFAIL *-*-*  return a;}template<> void bar::foo<int>(){                        // ERROR - not declared in bar - XFAIL *-*-*}template<class T,class U>class bar::X{};         // ERROR - does not match declaration

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?