If an operator is overloaded for a C++ class how could I use a default operator instead?

前端 未结 3 1106
一生所求
一生所求 2020-12-10 18:46

_com_ptr_ has an overloaded operator&() with a side effect. If I have a variable:

_com_ptr_t variable;

How could I ret

3条回答
  •  盖世英雄少女心
    2020-12-10 19:31

    I've seen this case pop up in an ISO meeting as it broke some offsetof() macro implementations (LWG 273). The solution: &reinterpret_cast(variable)

提交回复
热议问题