passing ‘const this argument discards qualifiers [-fpermissive]

后端 未结 3 437
一向
一向 2020-12-29 02:03

I have a class Cache which has a function write specified as

bool write(const MemoryAccess &memory_access, CacheLine &cl);
3条回答
  •  借酒劲吻你
    2020-12-29 02:32

    Also if your class's method returns pointer on any member you shouldn't forget write const before returning type example:

    const float * getPosition() const{...}

提交回复
热议问题