Difference between &(*similarObject) and similarObject? Are they not same?

后端 未结 3 1519
谎友^
谎友^ 2020-12-06 04:09

Can someone please explain this to me

dynamic_cast( &(*similarObject) );

What is the point of doing the address of

3条回答
  •  温柔的废话
    2020-12-06 04:57

    If similarObject is a smart pointer, this technique is sometimes used to get the reference of a raw pointer, when * has been overloaded.

提交回复
热议问题