I am looking over some open source code and they listed some strange instance in a class defined as:
Obj *&obj;
I had no idea that was possible! What does that mean or even do? The pointer and reference symbols should counteract in my opinion. But maybe it does something special I do not know about?
Looking in the code, they use it as if the instance was a pointer. ie: obj->method(). So then why did they include the &?
That is reference to a pointer. Think in this way:
It will print “pa is nullptr” on the console.
If you find
A * &difficult to read, then you can use typedef as: