c++ - How to const declare the this pointer sent as parameter -


I want to declare this indicator as an argument.

  Fixed zero class :: func (const other class * otherClass) {// To read the use of other class pointer, but do not write it. }  

It is being called in such a way:

  zero other class :: fenc () {class :: func (this); }  

This does not compile the nose, if I do not declare another class pointers, then I can change it.

Thank you.

You can not define constrained square memberv functions like this:

  Fixed zero class :: func (const OtherClass * otherClass) {// to read other class pointer but not to write it. }  

The function must be declared declare, and then the function definition looks:

  zero class :: func (const other class * OtherClass) { // read to use another class indicator, but do not write it. }  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -