名前空間
変種
操作

std::auto_ptr

提供: cppreference.com
< cpp‎ | memory

 
 
ユーティリティライブラリ
支援を入力します (basic types, RTTI, type traits)
動的なメモリ管理
エラー処理
プログラムユーティリティ
可変個引数関数
日付と時刻
関数オブジェクト
initializer_list(C++11)
bitset
hash(C++11)
関係演算子
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
ペアとタプル
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
フォワード、スワップ、および移動
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
動的なメモリ管理
低レベルのメモリ管理
アロケータ
Original:
Allocators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
allocator
allocator_traits(C++11)
allocator_arg_t(C++11)
allocator_arg(C++11)
uses_allocator(C++11)
scoped_allocator_adaptor(C++11)
ストレージを初期化されていない
Original:
Uninitialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
uninitialized_copy
uninitialized_copy_n(C++11)
uninitialized_fill
uninitialized_fill_n
raw_storage_iterator
get_temporary_buffer
return_temporary_buffer
スマートポインタ
Original:
Smart pointers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
unique_ptr(C++11)
shared_ptr(C++11)
weak_ptr(C++11)
auto_ptr(廃止予定)
owner_less(C++11)
enable_shared_from_this(C++11)
bad_weak_ptr(C++11)
default_delete(C++11)
ガベージコレクションをサポートしています
Original:
Garbage collection support
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declare_reachable(C++11)
undeclare_reachable(C++11)
declare_no_pointers(C++11)
undeclare_no_pointers(C++11)
pointer_safety(C++11)
get_pointer_safety(C++11)
その他
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pointer_traits(C++11)
addressof(C++11)
align(C++11)
Cライブラリ
Original:
C Library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::auto_ptr
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
auto_ptr::auto_ptr
auto_ptr::~auto_ptr
auto_ptr::operator=
auto_ptr::operator*
auto_ptr::operator->
auto_ptr::get
auto_ptr::release
auto_ptr::reset
auto_ptr::operator auto_ptr<Y>
 
Defined in header <memory>
template< class T > class auto_ptr;
(1) (廃止予定)
template<> class auto_ptr<void>
(2) (廃止予定)
auto_ptrauto_ptr自体が破壊された新しいオブジェクト、削除を介して取得されたオブジェクトを管理するスマートポインタです。これは、動的に割り当てられたオブジェクトの場合は、関数に動的に割り当てられたオブジェクトの所有権を渡すためと関数から動的に割り当てられたオブジェクトを返すための例外安全性を提供するために使用されるかもしれません.
Original:
auto_ptr is a smart pointer that manages an object obtained via new and deletes that object when auto_ptr itself is destroyed. It may be used to provide exception safety for dynamically-allocated objects, for passing ownership of dynamically-allocated objects into functions and for returning dynamically-allocated objects from functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
auto_ptrをコピーすると、宛先へのポインタと転送所有権をコピーします。auto_ptrのコピーコンストラクタとコピー代入の両方が彼らの右手の引数を変更し、 "コピー"はオリジナルと同じではありません。なぜなら、これらの異常なコピーのセマンティクス、auto_ptrは、標準的な容器に収納する必要がないかもしれません。 std::unique_ptrは、これと他の用途に適しています.
Original:
Copying an auto_ptr copies the pointer and transfers ownership to the destination: both copy construction and copy assignment of auto_ptr modify their right hand arguments, and the "copy" is not equal to the original. Because of these unusual copy semantics, auto_ptr may not be placed in standard containers. std::unique_ptr is preferred for this and other uses.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
タイプvoidための特殊化が提供され、それはtypedefelement_type、ないメンバ関数を宣言してい.
Original:
Specialization for type void is provided, it declares the typedef element_type, but no member functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] メンバータイプ

メンバー·タイプ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
element_type T

[編集] メンバ関数

新しいauto_ptrを作成します
Original:
creates a new auto_ptr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
auto_ptrをし、管理対象オブジェクトを破棄します
Original:
destroys an auto_ptr and the managed object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
別のauto_ptrから所有権を転送します
Original:
transfers ownership from another auto_ptr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
別の型へのポインタにマネージポインタに変換します
Original:
converts the managed pointer to a pointer to different type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
管理対象オブジェクトを破棄します
Original:
destroys the managed object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
管理対象オブジェクトの所有権を解放します
Original:
releases ownership of the managed object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
オブザーバー
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
管理対象オブジェクトへのポインタを取得します
Original:
obtains a pointer to the managed object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
管理対象オブジェクトにアクセスします
Original:
accesses the managed object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)