?? sizeof2.c
字號:
// { dg-do run }// Although template class B is not used at all, it causes the// incorrect specialization of A to be selected// Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>extern "C" void abort();template<int N, class T> // Base classclass A { public: static int n() { return sizeof(T); } };template<int N> // Derived #1class B: public A<N,char[N]> {};template<int N, int M> // Derived #2 (wrong!)class C: public A<N,char[M]> {};int main() { if (C<1,2>::n() != 2) abort();}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -