6 Dec
2007
6 Dec
'07
10:05 p.m.
On Dec 6, 2007 2:22 PM, Damien Hocking
[snip]
testPtr->*dptr = 5.7456;
On VS2005, I get an error on the ->*:
error C2296: '->*' : illegal, left operand has type 'boost::shared_ptr<T>'
This line is fine:
(*testPtr).*dptr = 5.7456;
Can anyone tell me why the compiler isn't converting boost::shared_ptr<TestObject> to a TestObject* through shared_ptr::operator-> ?
shared_ptr overloads the -> operator but not the ->* operator (they are two separate operators). In an expression like testPtr->*dptr = 5.7456; it's looking for the ->* operator, not ->. HTH, Stjepan