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

📄 init-ref3.c

📁 用于进行gcc测试
💻 C
字号:
// Origin: Peter Schmid <schmid@snake.iap.physik.tu-darmstadt.de>// { dg-do link }template <class T>class Ptr {protected:  T * ptr;public:    Ptr(void) : ptr(0) { }  Ptr(T * p) : ptr(p) { }    ~Ptr(void) { delete ptr; }    operator T & () { return *ptr; }};class base {public:   base(void) { }  ~base(void) { }};class foo : public base {private:  foo(const foo & rv);  public:    foo(void) { }  ~foo(void) { }};void func2(base & b) {  // ...}int main () {  Ptr<foo> f = new foo;  /* This should not result in a copy; the result of the conversion     operator should be bound directly to the reference argument to     `func2'.  */  func2(f);}

⌨️ 快捷键说明

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