spec17.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 45 行

C
45
字号
// Build don't link:template<class T>struct Foo { };template<class T1, class T2>struct BT { };template<class T1, class T2>struct BT< Foo<T1>, Foo<T2> > { static const int i = 1; };template<class T1, class T2>struct BT< T1, Foo<T2> > { static const int i = 2; };template<class T1, class T2>struct BT< Foo<T1>, T2 > { static const int i = 3; };template<class T1, class T2>int foo(Foo<T1>, Foo<T2>){  return 1;}template<class T1, class T2>int foo(T1, Foo<T2>){  return 2;}template<class T1, class T2>int foo(Foo<T1>, T2){  return 3;}void f(){  BT< double, Foo<int> >::i;  BT< Foo<int>, Foo<int> >::i;  BT< Foo<int>, float >::i;  foo(1.0, Foo<int>());  foo(Foo<int>(), Foo<int>());  foo(Foo<int>(), 1.0);}

⌨️ 快捷键说明

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