unique_ptr is not copyable or copy-assignable, two instances of unique_ptr cannot manage the same object. A non-const unique_ptr can transfer the ownership of the managed object to another unique_ptr. A const std::unique_ptr cannot be transferred, limiting the lifetime of the managed object to the scope in which the pointer was created. When the unique_ptr is destroyed, it disposes of the object through Deleter.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

std::unique_ptrの2つのバージョンがあります

Original:

There are two versions of std::unique_ptr:

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

1)

単一のオブジェクトの寿命は、例えば、管理newで確保

Original:

manages the lifetime of a single object, e.g. allocated with new

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

2)

ランタイム長さを持つ配列の寿命は、例えば、管理新しい[]で割り当てられます

Original:

manages the lifetime of an array with a runtime length, e.g. allocated with new[]

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

std::unique_ptrの典型的な用途は含まれています

Original:

Typical uses of std::unique_ptr include

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

例外を介して通常の出口と出口の両方で削除を保証することにより、動的な寿命を持つオブジェクトを処理するクラスと関数に例外安全性を提供する.

Original:

providing exception safety to classes and functions that handle objects with dynamic lifetime, by guaranteeing deletion on both normal exit and exit through exception.

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

関数に動的な寿命を持つユニークな所有オブジェクトの所有権を渡す

Original:

passing ownership of uniquely-owned objects with dynamic lifetime into functions

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.

関数からダイナミック生涯で一意に所有するオブジェクトの所有権を取得する

Original:

acquiring ownership of uniquely-owned objects with dynamic lifetime from functions

The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions.