Discussion about the RVO optimization technique & std::move.
RVO V.S. std::move
by Zhao Wu
From the article:
To summarize, RVO is a compiler optimization technique, while std::move is just an rvalue cast, which also instructs the compiler that it's eligible to move the object. The price of moving is lower than copying but higher than RVO, so never apply std::move to local objects if they would otherwise be eligible for the RVO.
Add a Comment
Comments are closed.