overload4.c

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

C
24
字号
// Build don't link: // GROUPS passed overloading  typedef void *		(*NewObject) (void);    class B  {  public:	static void WantsNew (NewObject creator); // ERROR - candidates are  };    class A  {  public:      static A * NewOne (void);        static void InitClass (void)      {	  B::WantsNew ( (NewObject) A::NewOne );	  // This used to die in convert_harshness_{ansi,old} cuz it	  // didn't know what to do about a void type.	  B::WantsNew ( A::NewOne );// ERROR -       }  };

⌨️ 快捷键说明

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