Menu

Restrict StrongPtr::GetPointer function?

Developers
2006-12-13
2013-04-08
  • Richard Sposato

    Richard Sposato - 2006-12-13

    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

     
    • Guillaume CHATELET

      This looks like a reasonable idea to me. Go for it ; )

      Cheers,
      Guillaume

       
    • Peter Kuemmel

      Peter Kuemmel - 2006-12-13

      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

       

Log in to post a comment.