tc13.c

来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 33 行

C
33
字号
// Brad Bisco found this one
struct QQ;
struct PP;

template <class T>
    struct LL {
	void a( QQ *p )
	{
	    p->no_no = 1;
	};
	void bad( PP *p )
	{
	    p->mega_no = 1;
	};
    };

class PP {
    int mega_no;
};

class QQ {
    friend class LL;	// all instantiations of LL are my friend
    int no_no;
};

LL<int> x;

void main()
{
    QQ z;
    x.a( &z );
}

⌨️ 快捷键说明

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