I've implemented a small framework in C++ which I use in a course I give at college, to help students implement their homework. One of the most valuable classes of that framework, is a smart pointer class, which as you can imagine, it overloads the ->
operator.
Recently I upgraded from VS2008 to VS2010, and occasionally I get issues with the intellisense after typing the operator. Instead of showing the methods and fields available in the pointed data type, it shows the methods and fields of the smart pointer class. Note this doesn't happen all the time, but once it happens, it's a little frustrating because I end up wasting a lot of time.
Have you experienced any trouble like this? Any idea or suggestion to work around this will be very appreciated.
This may sound like a minor issue, but It invalidates the use of VS2010 in the course till I can work this out.
Thanks in advanced!
EDIT
I've managed to reproduce the issue in a smaller context. Suppose I have something like this:
template <class T>
struct ptr
{
T* operator->(){ return 0; }
void otherMember() {}
};
template <class T>
struct node
{
T value;
};
template <class T>
void foo()
{
ptr<node<int>> pi;
ptr<node<T>> pt;
pi->value = 10; // OK, intellisense shows 'value'
pt-> // wrong! intellisense shows 'operator->()' and 'otherMember()', instead of 'value'
}
Does anyone experience the same behavior?