Partager via


unique_ptr Members

Reference

Constructors

unique_ptr::unique_ptr

There are seven constructors for unique_ptr.

Typedefs

deleter_type

A synonym for the template parameter Del.

element_type

A synonym for the template parameter Type.

pointer

A synonym for Del::pointer if defined, otherwise Type *.

Member Functions

unique_ptr::get

Returns stored_ptr.

unique_ptr::get_deleter

Returns a reference to stored_deleter.

unique_ptr::release

stores pointer() in stored_ptr and returns its previous contents.

unique_ptr::reset

Releases the currently owned resource and accepts a new resource.

unique_ptr::swap

Exchanges resource and deleter with the provided unique_ptr.

Operators

operator bool

The operator returns a value of a type that is convertible to bool. The result of the conversion to bool is true when get() != pointer(), otherwise false.

operator->

The member function returns stored_ptr.

operator*

The member function returns*stored_ptr.

unique_ptr operator=

Assigns the value of a unique_ptr (or a pointer-type) to the current unique_ptr.

See Also

Reference

unique_ptr Class

<memory>

Thread Safety in the Standard C++ Library

Other Resources

<memory> Members