run this code to see what the second const mean:

blaise (blaise)
#include "stdio.h"
class a
{
public:
void f(){printf("non const version\n");};
void f()const{printf("const version\n");};
};

void main()
{
a instanceofa;
const a constantinstanceofa;
instanceofa.f();
constantinstanceofa.f();
}

in fact, besides meaning it should change nothing of the instance, it also stands for a selector.
(#129525@0)
2001-7-12 -05:00

回到话题: C++ language question

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=129525