名前空間
変種
操作

std::scoped_allocator_adaptor::construct

提供: cppreference.com

 
 
動的なメモリ管理
低レベルのメモリ管理
アロケータ
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::scoped_allocator_adaptor
メンバ関数
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.
scoped_allocator_adaptor::scoped_allocator_adaptor
scoped_allocator_adaptor::~scoped_allocator_adaptor
scoped_allocator_adaptor::inner_allocator
scoped_allocator_adaptor::outer_allocator
scoped_allocator_adaptor::allocate
scoped_allocator_adaptor::deallocate
scoped_allocator_adaptor::max_size
scoped_allocator_adaptor::construct
scoped_allocator_adaptor::destroy
scoped_allocator_adaptor::select_on_container_copy_construction
非メンバ関数
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.
operator==
operator!=
 
Defined in header <scoped_allocator>
template < class T, class... Args >
void construct( T* p, Args&&... args )
(1)
template< class T1, class T2, class... Args1, class... Args2 >

void construct( std::pair<T1, T2>* p,
                std::piecewise_construct_t,
                std::tuple<Args1...> x,

                std::tuple<Args2...> y )
(2)
template< class T1, class T2 >
void construct( std::pair<T1, T2>* p )
(3)
template< class T1, class T2, class U, class V >
void construct( std::pair<T1, T2>* p, U&& x, V&& y )
(4)
template< class T1, class T2, class U, class V >
void construct( std::pair<T1, T2>* p, const std::pair<U, V>& xy )
(5)
template< class T1, class T2, class U, class V >
void construct( std::pair<T1, T2>* p, std::pair<U, V>&& xy );
(6)
割り当てにオブジェクトを構築しますが、初期化されていないストレージはpOuterAllocator、提供コンストラクタの引数を使用して指す。オブジェクトのタイプがある場合、その自体がアロケータを使用する場合、またはそれはstd :: pairであれば、構築されたオブジェクトにInnerAllocatorを下に渡し.
Original:
Constructs an object in allocated, but not initialized storage pointed to by p using OuterAllocator and the provided constructor arguments. If the object is of type that itself uses allocators, or if it is std::pair, passes InnerAllocator down to the constructed object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
まず、最も外側のアロケータ型を決定OUTERMOST:それはthis->outer_allocator()を呼び出し、次にそのようなメンバ関数を持たない型に到達するまで、この呼び出しの結果に再帰的にouter_allocator()メンバ関数を呼び出したときに返されることになるタイプです。そのタイプは、最も外側のアロケータです.
Original:
First, determines the outermost allocator type OUTERMOST: it is the type that would be returned by calling this->outer_allocator(), and then calling the outer_allocator() member function recursively on the result of this call until reaching the type that has no such member function. That type is the outermost allocator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
それから:
Original:
Then:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
std::uses_allocator<T, inner_allocator_type>::value==falseT(タイプstd::is_constructible<T, Args...>::value==trueはアロケータを使用していない)場合は、もし、次に呼び出します
Original:
If std::uses_allocator<T, inner_allocator_type>::value==false (the type T does not use allocators) and if std::is_constructible<T, Args...>::value==true, then calls
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
                                             p,
                                             std::forward<Args>(args)... );

それ以外の場合は、std::uses_allocator<T, inner_allocator_type>::value==trueT(タイプstd::is_constructible<T, std::allocator_arg_t, inner_allocator_type, Args...>::value==trueは、例えばそれがコンテナで、アロケータを使用しています)した場合とあれば、コール
Original:
Otherwise, if std::uses_allocator<T, inner_allocator_type>::value==true (the type T uses allocators, e.g. it is a container) and if std::is_constructible<T, std::allocator_arg_t, inner_allocator_type, Args...>::value==true, then calls
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
                                             p,
                                             std::allocator_arg,
                                             inner_allocator(),
                                             std::forward<Args>(args)... );

それ以外の場合は、std::uses_allocator<T, inner_allocator_type>::value==true(タイプT、それがコンテナである例えば、アロケータを使用している)、std::is_constructible<T, Args..., inner_allocator_type>::value==true場合は、次に呼び出されます
Original:
Otherwise, std::uses_allocator<T, inner_allocator_type>::value==true (the type T uses allocators, e.g. it is a container) and if std::is_constructible<T, Args..., inner_allocator_type>::value==true, then calls
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
                                             p,
                                             std::forward<Args>(args)...,
                                             inner_allocator());

std::uses_allocator<T>Tはアロケータ対応であると主張したが、それはアロケータを受け入れるコンストラクタのいずれかの形式を欠いているので、そうしないと、コンパイルエラーが発行され.
Original:
Otherwise, compilation error is issued because although std::uses_allocator<T> claimed that T is allocator-aware, it lacks either form of allocator-accepting constructors.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
まず、T1またはT2どちらかがアロケータ認識している場合、タプルを変更xy2新しいタプルで、その結果、適切なインナーアロケータを含めるxprimeyprime、次の3つのルールに従って:
Original:
First, if either T1 or T2 is allocator-aware, modifies the tuples x and y to include the appropriate inner allocator, resulting in the two new tuples xprime and yprime, according to the following three rules:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2a)のT1はアロケータ対応(std::uses_allocator<T1, inner_allocator_type>::value==false、その後xprimex、変更されていません。(それはまた、そのstd::is_constructible<T1, Args1...>::value==true必要です)
Original:
2a) if T1 is not allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==false, then xprime is x, unmodified. (it is also required that std::is_constructible<T1, Args1...>::value==true)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
図2b)T1は(std::uses_allocator<T1, inner_allocator_type>::value==true)アロケータを認識しているされていない場合、そのコンストラクタはアロケータタグ(かかる場合std::is_constructible<T1, std::allocator_arg_t, inner_allocator_type, Args1...>::value==true、その後xprimeです
Original:
2b) if T1 is allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), and its constructor takes an allocator tag (std::is_constructible<T1, std::allocator_arg_t, inner_allocator_type, Args1...>::value==true, then xprime is
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::tuple_cat( std::tuple<std::allocator_arg_t, inner_allocator_type&>( std::allocator_arg,
                                                                               inner_allocator_type()
                                                                              ), x)

2c)のT1場合は(std::uses_allocator<T1, inner_allocator_type>::value==true)アロケータを認識し、そのコンストラクタが最後の引数(std::is_constructible<T1, Args1..., inner_allocator_type>::value==true)としてアロケータをとり、その後xprimestd::tuple_cat(x, std::tuple<inner_allocator_type&>(inner_allocator_type()))です.
Original:
2c) if T1 is allocator-aware (std::uses_allocator<T1, inner_allocator_type>::value==true), and its constructor takes the allocator as the last argument (std::is_constructible<T1, Args1..., inner_allocator_type>::value==true), then xprime is std::tuple_cat(x, std::tuple<inner_allocator_type&>(inner_allocator_type())).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
同じ規則がT2yyprimeの交換に適用されます
Original:
Same rules apply to T2 and the replacement of y with yprime
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
一度xprimeyprime、(これがまたArgs1...とArgs2内のすべての種類が...CopyConstructibleであることが必要です)を構築呼び出しによって割り当てられた記憶領域内のペアpを構築しています
Original:
Once xprime and yprime are constructed (this also requires that all types in Args1... and Args2... are CopyConstructible), constructs the pair p in allocated storage by calling
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

std::allocator_traits<OUTERMOST>::construct( OUTERMOST(*this),
                                             p,
                                             std::piecewise_construct,
                                             xprime,
                                             yprime);


3)
彼らはそれらを受け入れる場合construct(p, std::piecewise_construct, std::tuple<>(), std::tuple<>())に相当する、つまり、ペアのメンバー·タイプへの内側のアロケータを渡し.
Original:
Equivalent to construct(p, std::piecewise_construct, std::tuple<>(), std::tuple<>()), that is, passes the inner allocator on to the pair's member types if they accept them.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
に相当する
Original:
Equivalent to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

    construct(p, std::piecewise_construct, std::forward_as_tuple(std::forward<U>(x)),
                                           std::forward_as_tuple(std::forward<V>(y)))

5)
に相当する
Original:
Equivalent to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

    construct(p, std::piecewise_construct, std::forward_as_tuple(xy.first),
                                           std::forward_as_tuple(xy.second))

6)
に相当する
Original:
Equivalent to
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

    construct(p, std::piecewise_construct, std::forward_as_tuple(std::forward<U>(xy.first)),
                                           std::forward_as_tuple(std::forward<V>(xy.second)))

目次

[編集] パラメータ

p -
割り当てられますが、初期化されていないストレージへのポインタ
Original:
pointer to allocated, but not initialized storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
args... -
コンストラクタは、引数Tのコンストラクタに渡す
Original:
the constructor arguments to pass to the constructor of T
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
x -
コンストラクタは、引数T1のコンストラクタに渡す
Original:
the constructor arguments to pass to the constructor of T1
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
y -
コンストラクタは、引数T2のコンストラクタに渡す
Original:
the constructor arguments to pass to the constructor of T2
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
xy -
その2つのメンバーT1のコンストラクタの引数であるとT2ペア
Original:
the pair whose two members are the constructor arguments for T1 and T2
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] 値を返します

(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[編集] ノート

この関数は、使用するアロケータとしてstd::allocator_traitsを与えられたようなstd::vectorなどの任意のアロケータアウェアオブジェクトによって(std::scoped_allocator_adaptorを通じて)と呼ばれています。 inner_allocatorstd::scoped_allocator_adaptorのインスタンス自体であるため、この関数を使用して構築さアロケータ対応オブジェクトが独自のメンバーの作成を開始するとき、この関数は、呼び出されます.
Original:
This function is called (through std::allocator_traits) by any allocator-aware object, such as std::vector, that was given a std::scoped_allocator_adaptor as the allocator to use. Since inner_allocator is itself an instance of std::scoped_allocator_adaptor, this function will also be called when the allocator-aware objects constructed through this function start constructing their own members.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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

[静的]
割り振られたストレージ内のオブジェクトを構築します
Original:
constructs an object in the allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]
割り振られたストレージ内のオブジェクトを構築します
Original:
constructs an object in allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数of std::allocator) [edit]