⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p5840.c

📁 linux下的gcc编译器
💻 C
字号:
// prms-id: 5840class Signal {public:  int Name(void) { return 1; }};class Derived : public Signal {public:  int Name(void) { return 2; }};template <class Foo , int (Foo::*Id)(void)>class Bar{public:  int value (Foo* a) { return (a->*Id)(); }};/* The following line is illegal under the new rules for non-type   template arguments in the standard, so it is commented out.  *//* template class Bar <Derived, &Signal::Name>; */template class Bar <Signal, &Signal::Name>;template class Bar <Derived, &Derived::Name>;Derived a;/* Bar<Derived, &Signal::Name> dispatcher1; */Bar<Derived, &Derived::Name> dispatcher2;int main() {  /* int i1 = dispatcher1.value(&a); */  int i2 = dispatcher2.value(&a);  return /* i1 != 1 || */ i2 != 2;}

⌨️ 快捷键说明

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