这个函数结构怎么理解inline void* CSimpleList::GetNext(void* preElement) const{ return *GetNextPtr(preElement); }我最不能理解的就是 const 放在那个位置是什么意思

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/09 05:34:01
这个函数结构怎么理解inline void* CSimpleList::GetNext(void* preElement) const{ return *GetNextPtr(preElement); }我最不能理解的就是 const 放在那个位置是什么意思
xݑJ@_%ZЍ'2HMC: Bb^^J/i̜$o4ҝ"J]3mR,h%:3r}KrBpNThOJXl}tCh'HIJN+AE\

这个函数结构怎么理解inline void* CSimpleList::GetNext(void* preElement) const{ return *GetNextPtr(preElement); }我最不能理解的就是 const 放在那个位置是什么意思
这个函数结构怎么理解
inline void* CSimpleList::GetNext(void* preElement) const
{ return *GetNextPtr(preElement); }
我最不能理解的就是 const 放在那个位置是什么意思

这个函数结构怎么理解inline void* CSimpleList::GetNext(void* preElement) const{ return *GetNextPtr(preElement); }我最不能理解的就是 const 放在那个位置是什么意思
一般加那个const的函数都是读取内容的函数
被const修饰的成员函数,表明他不会修改任何成员变量,仅仅会读.
象标准库里面所有的get函数都是const的