Hi,
[VS2005 english SP1, C++]
I finally set up a test case of a problem that is bugging me since I started using VAX. Consider the following code:
#include <boost/shared_ptr.hpp>
template <class T>
class MyIterator {
public:
MyIterator(T value) : _value(value) {}
T operator*() const { return _value; }
T operator ->() const { return _value; }
private:
T _value;
};
struct MyStruct {
long x,y;
};
typedef boost::shared_ptr<MyStruct> MyPointer;
void main(void)
{
MyIterator<MyPointer> iter(MyPointer(new MyStruct()));
long value = iter->x;
}
Now the kick is that C++ chains -> operator until it gets a type that has no -> operator. Thus, the iter->x code is legal and does compile, even though two -> operators are evaluated (first from the iterator and then from boost::shared_ptr).
VAX however only evaluates the first and suggests the boost::shared_ptr members instead of the MyStruct members (I will send a screenshot). This is really annoying because we use lots of shared pointers and a good deal of custom iterators...
Regards, tv