美文网首页
C++ static const operator

C++ static const operator

作者: 邱廷浩 | 来源:发表于2020-09-02 10:09 被阅读0次

static 修饰为静态函数只能调用静态函数和变量
const 修饰为常量函数只能调用常量函数和变量

常引用作为函数的参数 一般作用是为了保护原参数

void display(const double &d) {}; 此时d所引用的对象就不能被改变 只能使用

operator++ // 前置重载符
operator++(int a) //后置

相关文章

网友评论

      本文标题:C++ static const operator

      本文链接:https://www.haomeiwen.com/subject/rfkusktx.html