Omer Katz - 2007-04-19

I encountered some problems using the SmartPtr with an operator overloading of ->
I have a class that must overload -> but since SmartPtr already overloaded it, it doesn't call my overload.
I wonder if you can add an optional parameter that will specialize SmartPtr to do something like this:

PointeeType operator-> (){ return PointeeType->operator->(); }

Also I have a problem when I overload [].
To use the overloaded [] I need to make a wrapper class just to make it readable.
I would like to have two extra parameters for this.
One boolean that indicates if I overloaded [] and the second is the type of what's in [].
For example:
SmartPtr<MyClass, ..., true, std::string> ptr;
ptr["bla bla bla"].foo();

Omer