Ten key points for mastering C++ right-valued references: how to properly handle pure right values and would-be dead values
Recently I have been reading a lot of material on C++ right-values due to my work. In C++, right-valued is a very important concept that is crucial to understand the internal mechanisms of C++ and to implement efficient code. In this article, I will summarize 10 practical lessons about right values. There are two types of C++ right values: pure right values, and will-be-dead values. A right-valued reference extends the life cycle of a will-be-dead value, allowing the will-be-dead value to be used normally and not released by mistake. One effect of right-value references is to extend the life cycle of right values. A right-value reference extends the life cycle of a would-be-dead value, allowing the would-be-dead value to be used normally and not released by mistake. Temporary … Read more