std::uninitialized_copy
提供:cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
| Defined in header <memory>
|
||
| template< class InputIt, class Size, class ForwardIt > ForwardIt uninitialized_copy_n( InputIt first, Size count, ForwardIt d_first); |
(C + + 11以来) | |
コピー
countfirstで初期化されていないメモリ領域の先頭にd_firstで始まる範囲から要素。初期化されていない領域内の要素は、コピーコンストラクタを使用して構築されてい.Original:
Copies
count elements from a range beginning at first to an uninitialized memory area beginning at d_first. The elements in the uninitialized area are constructed using copy constructor.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
例外は、初期化時にスローされた場合、この関数は何の効果もありません。
| This section is incomplete Reason: update possible implementation to reflect this |
Original:
If an exception is thrown during the initialization, the function has no effects.
| This section is incomplete Reason: update possible implementation to reflect this |
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
| first | - | コピーする要素の範囲の先頭
Original: the beginning of the range of the elements to copy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| d_first | - | 目的の範囲の始まり
Original: the beginning of the destination range The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| Type requirements | ||
-InputIt must meet the requirements of InputIterator.
| ||
-ForwardIt must meet the requirements of ForwardIterator.
| ||
[編集] 値を返します
コピーされた最後の要素過去の要素を指すイテレータ.
Original:
Iterator to the element past the last element copied.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 複雑
countのリニア.Original:
Linear in
count.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 可能な実装
template<class InputIt, class Size, class ForwardIt> ForwardIt uninitialized_copy_n(InputIt first, Size count, ForwardIt d_first) { typedef typename std::iterator_traits<ForwardIt>::value_type Value; for (; count > 0; ++first, ++d_first, --count) { ::new (static_cast<void*>(&*d_first)) Value(*first); } return d_first; } |
[編集] 例
| This section is incomplete Reason: no example |
[編集] も参照してください
| メモリの初期化されていない領域へのオブジェクトの範囲をコピーします Original: copies a range of objects to an uninitialized area of memory The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) | |