std::raw_storage_iterator
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 OutputIt, class T > class raw_storage_iterator : public std::iterator<std::output_iterator_tag, void, void, void, void>; |
||
Le
std::raw_storage_iterator itrateur de sortie permet aux algorithmes standard pour stocker les rsultats dans la mmoire non initialise. Chaque fois que l'algorithme crit un objet de type T l'itrateur drfrenc, l'objet est la copie construite l'emplacement de stockage non initialise dans le point par l'itrateur. Le OutputIt paramtre de modle est un type qui rpond aux exigences de thee OutputIterator et a operator* dfinie pour renvoyer un objet, pour lequel operator& retourne un objet de type de T*. Habituellement, le T* type est utilis comme OutputIt .Original:
The output iterator
std::raw_storage_iterator makes it possible for standard algorithms to store results in uninitialized memory. Whenever the algorithm writes an object of type T to the dereferenced iterator, the object is copy-constructed into the location in the uninitialized storage pointed to by the iterator. The template parameter OutputIt is any type that meets thee requirements of OutputIterator and has operator* defined to return an object, for which operator& returns an object of type T*. Usually, the type T* is used as OutputIt.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.
Exigences de type
-OutputIt must meet the requirements of OutputIterator.
|
Fonctions membres
cre un nouveau raw_storage_iterator Original: creates a new raw_storage_iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
retourne une rfrence la prsente raw_storage_iterator Original: returns a reference to this raw_storage_iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
la copie d'un objet construit l'emplacement point dans la mmoire tampon Original: copy-constructs an object at the pointed-to location in the buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
progrs de l'itrateur Original: advances the iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) | |
Inherited from std::iterator
Member types
| Type du membre | Dfinition |
value_type
|
void
|
difference_type
|
void
|
pointer
|
void
|
reference
|
void
|
iterator_category
|
std::output_iterator_tag
|
Exemple
#include <iostream>
#include <string>
#include <memory>
#include <algorithm>
int main()
{
const std::string s[] = {"This", "is", "a", "test", "."};
std::string* p = std::get_temporary_buffer<std::string>(5).first;
std::copy(std::begin(s), std::end(s),
std::raw_storage_iterator<std::string*, std::string>(p));
for(std::string* i = p; i!=p+5; ++i) {
std::cout << *i << '\n';
i->~basic_string<char>();
}
std::return_temporary_buffer(p);
}
Rsultat :
This
is
a
test
.
Voir aussi
(C++11) |
fournit des informations sur les types d'allocateur (classe gnrique) |
(C++11) |
met en oeuvre plusieurs niveaux d'affectation de niveaux multiples rcipients Original: implements multi-level allocator for multi-level containers The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe gnrique) |
(C++11) |
vrifie si le type spcifi prend en charge les utilisations-allocateur de construction Original: checks if the specified type supports uses-allocator construction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe gnrique) |