How can I reliably get an object's address when operator& is overloaded?

前端 未结 5 1375
野性不改
野性不改 2020-11-27 09:55

Consider the following program:

struct ghost
{
    // ghosts like to pretend that they don\'t exist
    ghost* operator&() const volatile { return 0; }
}         


        
5条回答
提交回复
热议问题