Menu

#163 Missing const on -> for SmartPtr's LockedStorage policy

closed-fixed
None
5
2009-09-26
2009-06-09
hodoulp
No

I think that a const is missing for the '->' of SmartPtr's LockedStorage policy .

Code Snippet:

int main()
{
const Loki::SmartPtr<MyClass, Loki::COMRefCounted,
Loki::DisallowConversion,
Loki::NoCheck,
Loki::LockedStorage>
sp( new MyClass );

sp->doSomething(); // compilation breaks
}
// gcc 3.4.4

int SmartPtr.h, line 19, the '->' does not have the const keyword.
If I check other policies, they all have the const.

Discussion

  • hodoulp

    hodoulp - 2009-06-09

    main.cpp

     
  • hodoulp

    hodoulp - 2009-06-09

    Sorry, I sent my email too fast.

    My impression is that the const is missing. Based on my experiments, it fixes my problem
    without adding side-effects.

    But I would like to know if there were reason(s) to not have this const.

    Thanks, Patrick.

     
  • Richard Sposato

    Richard Sposato - 2009-09-24
    • assigned_to: nobody --> rich_sposato
     
  • Richard Sposato

    Richard Sposato - 2009-09-24

    I think the const is missing due to simple oversight. I will take a look at this one.

    Thanks for letting us know!

    Rich

     
  • Richard Sposato

    Richard Sposato - 2009-09-26
    • status: open --> closed-fixed
     
  • Richard Sposato

    Richard Sposato - 2009-09-26

    Fixed in revision 1021.
    Added const qualifier to operator->,

     

Log in to post a comment.