Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Casts from one kind of auto_ptr to another kind of auto_ptr.
template<class Other>
operator auto_ptr<Other>( ) throw( );
Return Value
The type cast operator returns auto_ptr <Other>(*this).
Example
// 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;
}
Requirements
Header: <memory>
Namespace: std