##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::auto_ptr::operator auto_ptr<Y>

From cppreference.com
< cpp‎ | memory‎ | auto ptr

template< class Y > operator auto_ptr_ref<Y>(); | (1) | (deprecated)
template< class Y > operator auto_ptr<Y>(); | (2) | (deprecated)

Converts *this to an `auto_ptr` for a different type `Y`.

1) Returns an implementation-defined type that holds a reference to *this. The implementation is allowed to provide the template with a different name or implement equivalent functionality in other ways.
2) Constructs a new `auto_ptr` with a pointer obtained by calling release().

### [edit] Parameters

(none)

### [edit] Return value

1) An implementation-defined type that holds a reference to *this
2) A `auto_ptr` with a pointer obtained by calling release().

### [edit] Exceptions

(none)

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/memory/auto_ptr/operator_auto_ptr&oldid=64298"