【C++】template 統合スレ -- STL/Boost/Loki, etc.
■ このスレッドは過去ログ倉庫に格納されています
003231
NGNGtemplate<class T, class U>
std::auto_ptr<T> cast(std::auto_ptr<U>& ref, std::auto_ptr<T>&)
{ return std::auto_ptr<T>( ref.release() ); }
だね。
つーか、むしろ
template<typename T, typename U>
T cast(U &ref, T &) {return T(ref.release());}
■ このスレッドは過去ログ倉庫に格納されています