名前空間
変種
操作

std::atomic_is_lock_free<std::shared_ptr>, std::atomic_load<std::shared_ptr>, std::atomic_store<std::shared_ptr>, std::atomic_...<std::shared_ptr>

提供: cppreference.com
< cpp‎ | memory‎ | shared ptr

 
 
ユーティリティライブラリ
支援を入力します (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::shared_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.
shared_ptr::shared_ptr
shared_ptr::~shared_ptr
shared_ptr::operator=
修飾子
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
shared_ptr::reset
shared_ptr::swap
オブザーバー
Original:
Observers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
shared_ptr::get
shared_ptr::operator*
shared_ptr::operator->
shared_ptr::use_count
shared_ptr::unique
shared_ptr::operator bool
shared_ptr::owner_before
非メンバ関数
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::swap
make_shared
allocate_shared
static_pointer_cast
dynamic_pointer_cast
const_pointer_cast
get_deleter
operator==
operator|=
operator<
operator<=
operator>
operator>=
operator<<
atomic_is_lock_free
atomic_load
atomic_load_explicit
atomic_store
atomic_store_explicit
atomic_exchange
atomic_exchange_explicit
atomic_compare_exchange_weak
atomic_compare_exchange_strong
atomic_compare_exchange_weak_explicit
atomic_compare_exchange_strong_explicit
std::hash
 
template< class T >
bool atomic_is_lock_free( const std::shared_ptr<T>* p );
(1) (C + + 11以来)
template< class T >
std::shared_ptr<T> atomic_load( const std::shared_ptr<T>* p );
(2) (C + + 11以来)
template< class T >

std::shared_ptr<T> atomic_load_explicit( const shared_ptr<T>* p,

                                         std::memory_order mo );
(3) (C + + 11以来)
template< class T >

void atomic_store( std::shared_ptr<T>* p,

                   std::shared_ptr<T> r );
(4) (C + + 11以来)
template< class T >

void atomic_store_explicit( std::shared_ptr<T>* p,
                            shared_ptr<T> r,

                            std::memory_order mo);
(5) (C + + 11以来)
template< class T >

std::shared_ptr<T> atomic_exchange( std::shared_ptr<T>* p,

                                    std::shared_ptr<T> r);
(6) (C + + 11以来)
template<class T>

std::shared_ptr<T> atomic_exchange_explicit( std::shared_ptr<T>* p,
                                             std::shared_ptr<T> r,

                                             std::memory_order mo);
(7) (C + + 11以来)
template< class T >

bool atomic_compare_exchange_weak( std::shared_ptr<T>* p,
                                   std::shared_ptr<T>* expected,

                                   std::shared_ptr<T> desired);
(8) (C + + 11以来)
template<class T>

bool atomic_compare_exchange_strong( std::shared_ptr<T>* p,
                                     std::shared_ptr<T>* expected,

                                     std::shared_ptr<T> desired);
(9) (C + + 11以来)
template< class T >

bool atomic_compare_exchange_strong_explicit( std::shared_ptr<T>* p,
                                              std::shared_ptr<T>* expected,
                                              std::shared_ptr<T> desired,
                                              std::memory_order success,

                                              std::memory_order failure);
(10) (C + + 11以来)
template< class T >

bool atomic_compare_exchange_weak_explicit( std::shared_ptr<T>* p,
                                            std::shared_ptr<T>* expected,
                                            std::shared_ptr<T> desired,
                                            std::memory_order success,

                                            std::memory_order failure);
(11) (C + + 11以来)
複数の実行スレッドが同期しなくても同じstd::shared_ptrによって参照されるオブジェクトにアクセスした場合はすべてのようなアクセスが対応するアトミックアクセス関数の部分特殊化(std::atomic_loadstd::atomic_storeなど)がこれらの機能を介して実行されていない限り、データの競合が発生することがあります
Original:
If multiple threads of execution access the object referenced by the same std::shared_ptr without synchronization, a data race may occur, unless all such access is performed through these functions, which are partial specializations of the corresponding atomic access functions (std::atomic_load, std::atomic_store, etc)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
{{{1}}}
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
指摘ツーpによって共有ポインタへのアトミックアクセスがロックフリーであるかどうかを判断し.
Original:
Determines whether atomic access to the shared pointer pointed-to by p is lock-free.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
atomic_load_explicit(p, std::memory_order_seq_cst)に相当する
Original:
Equivalent to atomic_load_explicit(p, std::memory_order_seq_cst)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
pによって指し示さツー共有ポインタを返します。非専門std::atomic_load_explicitと同様に、mostd::memory_order_releaseまたはstd::memory_order_acq_relすることはできません
Original:
Returns the shared pointer pointed-to by p. As with the non-specialized std::atomic_load_explicit, mo cannot be std::memory_order_release or std::memory_order_acq_rel
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
atomic_store_explicit(p, r, memory_order_seq_cst)に相当する
Original:
Equivalent to atomic_store_explicit(p, r, memory_order_seq_cst)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
スワップ共有ポインタpr、効果的にp->swap(r)を実行する。非専門std::atomic_store_explicitと同様に、mostd::memory_order_acquireまたはstd::memory_order_acq_relすることはできません
Original:
Swaps the shared pointers p and r, effectively executing p->swap(r). As with the non-specialized std::atomic_store_explicit, mo cannot be std::memory_order_acquire or std::memory_order_acq_rel
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
atomic_exchange_explicit(p, r, memory_order_seq_cst)に相当する
Original:
Equivalent to atomic_exchange_explicit(p, r, memory_order_seq_cst)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7)
スワップ共有ポインタpr、効果的にp->swap(r)を実行しpによって共有ポインタ以前指摘へのコピーを返します
Original:
Swaps the shared pointers p and r, effectively executing p->swap(r) and returns a copy of the shared pointer formerly pointed-to by p
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
8)
atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)に相当する
Original:
Equivalent to atomic_compare_exchange_weak_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
9)
atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)に相当する
Original:
Equivalent to atomic_compare_exchange_strong_explicit(p, expected, desired, std::memory_order_seq_cst, std::memory_order_seq_cst)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
10)
共有ポインタを比較することによってツーを指摘pexpected。それらが同等である場合には、(株式同じポインタの所有権と同じポインタを参照してください)​​、desired*pとリターンsuccessによって指定された制約を注文メモリを使用するのにtrueを割り当てます。それらは等価ではありません場合は、*pによって指定された制約を返し*expectedを注文メモリを使用してfailurefalseを割り当て.
Original:
Compares the shared pointers pointed-to by p and expected. If they are equivalent (share ownership of the same pointer and refer to the same pointer), assigns desired into *p using the memory ordering constraints specified by success and returns true. If they are not equivalent, assigns *p into *expected using the memory ordering constraints specified by failure and returns false.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
11)
)10と同じですが、擬似的に失敗することがあります.
Original:
Same as 10), but may fail spuriously.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pがNULLポインターである場合は、すべてのこれらの関数は未定義の動作を呼び出す.
Original:
All these functions invoke undefined behavior if p is a null pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] パラメータ

p, expected -
std::shared_ptrへのポインタ
Original:
a pointer to a std::shared_ptr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
r, desired - a std::shared_ptr
mo, success, failure -
メモリは型std::memory_orderのセレクタを注文
Original:
memory ordering selectors of type std::memory_order
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 例外

これらの関数は例外をスローしません.
Original:
These functions do not throw exceptions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 返す

1)
trueアトミックアクセスがロックフリーの命令を使用して実装されている場合
Original:
true if atomic access is implemented using lock-free instructions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ 2,3 @尖っツー共有ポインタのコピー.
Original:
@2,3@ A copy of the pointed-to shared pointer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ 4,5 @何もありません
Original:
@4,5@ nothing
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ 6,7 @以前はポイント先の共有ポインタのコピー
Original:
@6,7@ A copy of the formerly pointed-to shared pointer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
@ 8,9,10,11 @true共有ポインタは同等であったとの交換が実行されたかどうか、そうでなければfalse.
Original:
@8,9,10,11@ true if the shared pointers were equivalent and the exchange was performed, false otherwise.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] も参照してください

原子型の事業かどうかをチェックするには、ロックフリーです
Original:
checks if the atomic type's operations are lock-free
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
アトミックに非アトミック引数でアトミックオブジェクトの値を置き換えます
Original:
atomically replaces the value of the atomic object with a non-atomic argument
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
アトミックアトミックオブジェクトに格納されている値を取得します
Original:
atomically obtains the value stored in an atomic object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
アトミックに非アトミック引数でアトミックオブジェクトの値を置き換え、原子の古い値を返します
Original:
atomically replaces the value of the atomic object with non-atomic argument and returns the old value of the atomic
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
アトミックに非アトミック引数でアトミックオブジェクトの値を比較し、等しいか、またはアトミックロードする場合しない場合、原子交換を行う
Original:
atomically compares the value of the atomic object with non-atomic argument and performs atomic exchange if equal or atomic load if not
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]