I've been asked by Loki aficionado if I could restrict the StrongPtr::GetPointer function. He recommends that I make the function private instead of public. I made it public partly for convenience and testing, but since it is public any code can get access to the real pointer thereby make the use of smart pointers moot.
I'd appreciate your thoughts on the matter.
Thanks,
Rich
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What about making it protected?
Then the function is not 'lost',
but you could not use it by
'accident', you must inherit
from the template to get access
to the raw pointer.
Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Everyone,
I've been asked by Loki aficionado if I could restrict the StrongPtr::GetPointer function. He recommends that I make the function private instead of public. I made it public partly for convenience and testing, but since it is public any code can get access to the real pointer thereby make the use of smart pointers moot.
I'd appreciate your thoughts on the matter.
Thanks,
Rich
This looks like a reasonable idea to me. Go for it ; )
Cheers,
Guillaume
What about making it protected?
Then the function is not 'lost',
but you could not use it by
'accident', you must inherit
from the template to get access
to the raw pointer.
Peter