Posted on November 16th, 2008 at 22:57 by fr3@K
Rvalue-References 是 C++0x 規範的新 language feature, 也是繼 Templates 後, IMO, C++ 語言最重要的 language feature. 其目的是為了支持 Move Semantics — 將 resource 從一個 instance 轉移到另一個 instance.
Rvalue — 這個聽起來饒舌的新名詞 — 說穿了其實就是 un-named instance (i.e. temporary), 反之, 有名字的 (named) 則為 lvalue. 而 const/volatile 與否則是額外的修飾. 也就是說, 一個 rvalue reference 其實就是 reference to a temporary.
(more…)
Except where otherwise noted, COdE fr3@K by
fr3@K is licensed under a
Creative Commons Attribution-Share Alike 3.0 License.