2004-08-28から1日間の記事一覧

かんすーのもどりち

C++

// std名前空間内に以下が定義されていると仮定 namespace std{ template<class T> struct move_traits { typedef typename T::move_type move_type; static move_type move(T &x){ return x.move(); } }; template<class T> typename move_traits<T>::move_type move(T &x) { ret</t></class></class>…

move

C++

うおー!moveすげー!ちょーすげー!

container of move_ptr

C++

あー.move_ptrがあれば安全なCOAP(COMP)が実現できるのか.あー,あー,あー・・・.(←物が言えない)

rvalueのみを選択的に透過するSFINAE

C++

http://tinyurl.com/3f6sw を参考にしてみる.以下はVC++7.1で動作確認済み. #include <iostream> template<class T> struct delayed; template<class T> struct error_if_const; template<class T> struct error_if_const<T const> { typedef typename delayed<T>::error type; }; template<class T> void f(T const &</class></t></t></class></class></class></iostream>…