对象 | 成员函数 | 对/错 | |
1 | const | const | 对 |
2 | const | not-const | 错 |
3 | non-const | const | 对 |
4 | not-const | not-const | 对 |
上表为利用对象调用成员函数
成员函数 | 成员函数 | 对/错 | |
1 | const | const | 对 |
2 | const | not-const | 错 |
3 | not-const | const | 对 |
4 | not-const | not-const | 对 |
对象 | 成员函数 | 对/错 | |
1 | const | const | 对 |
2 | const | not-const | 错 |
3 | non-const | const | 对 |
4 | not-const | not-const | 对 |
上表为利用对象调用成员函数
成员函数 | 成员函数 | 对/错 | |
1 | const | const | 对 |
2 | const | not-const | 错 |
3 | not-const | const | 对 |
4 | not-const | not-const | 对 |