在http://herbsutter.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/中,它提到"最重要的const",其中C++故意指定绑定临时对象在堆栈上引用const会延长临时生命周期到引用本身的生命周期.我想知道为什么c ++只允许在引用为const时延长对象的生命周期而不是在不引用时延长对象的生命周期?这个特征背后的理性是什么?为什么它必须是const?
c++ const
c++ ×1
const ×1