2008-03-05から1日間の記事一覧

C++0x 右辺値参照 std::forward

C++

前回、std::moveを紹介したが、右辺値参照のためにはもう1つ std::forwardが用意される namespace std { template <class T> struct identity { typedef T type; }; template <class T> inline T&& forward(typename identity<T>::type&& x) { return x; } } まず、右辺値参照(&&</t></class></class>…