std::uninitialized_fill
De 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. |
<metanoindex/>
<tbody> </tbody>| Dclar dans l'en-tte <memory>
|
||
template< class ForwardIt, class T > void uninitialized_fill( ForwardIt first, ForwardIt last, const T& value ) |
||
Copie la valeur
value donn une zone de mmoire non initialise, dfinie par la plage [first, last). Les lments de la zone non initialise sont construites en utilisant constructeur de copie .Original:
Copies the given value
value to an uninitialized memory area, defined by the range [first, last). 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.
Paramtres
| first, last | - | l'intervalle des lments initialiser
Original: the range of the elements to initialize The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| value | - | la valeur pour la construction des lments de
Original: the value to construct the elements with The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| Type requirements | ||
-ForwardIt must meet the requirements of ForwardIterator.
| ||
Retourne la valeur
(Aucun)
Original:
(none)
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.
Complexit
Linaire de la distance entre
first et lastOriginal:
Linear in the distance between
first and lastThe 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.
Mise en uvre possible
template<class ForwardIt, class T>
void uninitialized_fill(ForwardIt first,
ForwardIt last,
const T& value)
{
typedef typename std::iterator_traits<ForwardIt>::value_type Value;
for (; first != last; ++first) {
::new (static_cast<void*>(&*first)) Value(value);
}
}
|
Exemple
| This section is incomplete Reason: no example |
Voir aussi
copie un objet dans une zone non initialise de la mmoire Original: copies an object 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. (fonction gnrique) | |