I have a smart pointer class (CPointer). Now I need to be able to pass back smart pointers which point to a const.
In other words I need to be able to model this behaviour:
SomeObject *get_Message() ;
const SomeObject *get_Message() ;
by using this kind of syntax perhaps?
CPointer<const SomeObject> get_Message() ;
const CPointer<SomeObject> get_Message() ;
doesn't work because that just means that the pointer can't change, not that the object within it can't change.
Do I have to use a template specialization for this, and if so how? Will this work?
template<> class CPointer<Const Element>