I've came across the following code, ok, not exactly but close. The point of interest is the second line in the (heavily abbreviated code). Why does one have to intialize someReference 'someReference' ? Other then be able to use . operator instead of -> ? ptrThis is just as good, no? (it's inside the thread method, if that makes any difference)
// this line, why? SomeClass & someReference(*ptrThis); unsigned SomeClass::someThread(void *ptr) { SomeClass *ptrThis = reinterpret_cast<SomeClass*>(ptr); SomeClass & someReference(*ptrThis); // some other code }