I have seen this in our code a couple times and it immediately makes me suspicious. But since I don't know the original intent I am hesitant to remove it.
//requires double indirection which I won't go into
FooClass::FooFunction(void ** param)
{
//do something
}
SomeClass * A = new SomeClass();
SomeClass **B = &A;
FooFunction( reinterpret_cast<void**>(&*B) ); // what is happening here?
The "&*B" part is the part in question? Feel free to integrate explanation of the reinterpret cast but I am pretty familiar with cast techniques.
I've done similar things with iterators - dereference the iterator to get a reference, and then do the "&" operator to get a pointer.
I don't see why it would be doing anything here though. If the type to the right of "&*" is a pointer type it does nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With