auto_ptr::operator auto_ptr<Other>

Umwandlungen von einer Art auto_ptr zu einer anderen Art auto_ptr.

template<class Other>
   operator auto_ptr<Other>( ) throw( );

Rückgabewert

Der Typumwandlungsoperator gibt auto_ptr <Andere> zurück (*this).

Beispiel

// 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;
}

Anforderungen

Header: <memory>

Namespace: std

Siehe auch

Referenz

auto_ptr Class