Addition (since laserlight supposed a function returning a const <type> *):
Alternative function to get the const pointer:
in main:Code:const class T* GetT(){return &g_t;};
With regardsCode:class T* t = GetT(); // not possible => compiler error const class T* t = GetT(); // possible t->ConstMethod(); // possible t->Method2ChangeData(); // not possible => compiler error
Programartist




Reply With Quote