这如何返回引用?

Noo*_*ble -1 c++ reference

我一直在努力学习如何使用单例设计模式并偶然发现:

    static S& getInstance()
    {
        static S instance;
        return instance;
    }
Run Code Online (Sandbox Code Playgroud)

我注意到它返回了instance,它不应该归还instance&吗?

编辑:我还应该提到编译器似乎没有提出任何投诉.

Bau*_*gen 7

return instance;确实会返回引用instance.就是这样

int& r = a;
Run Code Online (Sandbox Code Playgroud)

有些人int a创建了一个引用,a无需编写a&或类似的东西.