あぁ >>25 のままじゃcompileできんな
template<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());}