auto_ptr::operator auto_ptr<Other>
Casts from one kind of auto_ptr to another kind of auto_ptr.
template<class Other>
operator auto_ptr<Other>( ) throw( );
반환 값
The type cast operator returns auto_ptr <Other>(*this).
예제
// auto_ptr_op_auto_ptr.cpp
// compile with: /EHsc
#include <memory>
#include <iostream>
#include <vector>
using namespace std;
int main()
{
auto_ptr<int> pi ( new int( 5 ) );
auto_ptr<const int> pc = ( auto_ptr<const int> )pi;
}
요구 사항
헤더 <memory>
네임스페이스: std