Deprecated: Typecho\Widget\Request::getServer(): Implicitly marking parameter $default as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/blog.kanosaikou.cn/var/Typecho/Widget/Request.php on line 223

Deprecated: Typecho\Request::getServer(): Implicitly marking parameter $default as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/blog.kanosaikou.cn/var/Typecho/Request.php on line 361

Deprecated: Typecho\Widget\Response::goBack(): Implicitly marking parameter $suffix as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/blog.kanosaikou.cn/var/Typecho/Widget/Response.php on line 158

Deprecated: Typecho\Widget\Response::goBack(): Implicitly marking parameter $default as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/blog.kanosaikou.cn/var/Typecho/Widget/Response.php on line 158
引用、友元、重载

拾雨

引用、友元、重载

引用

定义格式

type & 名称

int a;
int &b=a;

b和a表示同一个对象

注意事项

用引用返回值


友元

允许外面的类和函数访问另一个类的私有成员

特性

慎用友元

不必要情况下无需使用友元,因为是对封装性的破坏

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »