[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/container/queue/queue [Back]  [Original]

std::queue::queue cppreference.com
cppreference.com
Espaces de noms
Variantes

std::queue::queue

De cppreference.com

<metanoindex/>

 
 
 
std :: file d'attente
Les fonctions membres
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.
queue::queue
queue::~queue
queue::operator=
Elment d'accs
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
queue::front
queue::back
Capacit
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
queue::empty
queue::size
Modificateurs
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
queue::push
queue::emplace
queue::pop
queue::swap
 
<tbody> </tbody>
explicit queue( const Container& cont = Container() ); explicit queue( const Container& cont );
(1) (avant C++11)
(depuis C++11)
explicit queue( Container&& cont = Container() );
(2) (depuis C++11)
queue( const queue& other );
(3)
queue( queue&& other );
(4) (depuis C++11)
template< class Alloc > explicit queue( const Alloc& alloc );
(5) (depuis C++11)
template< class Alloc > queue( const Container& cont, const Alloc& alloc );
(6) (depuis C++11)
template< class Alloc > queue( Container&& cont, const Alloc& alloc );
(7) (depuis C++11)
template< class Alloc > queue( const queue& other, const Alloc& alloc );
(8) (depuis C++11)
template< class Alloc > queue( queue&& other, const Alloc& alloc );
(9) (depuis C++11)
Construit nouveau conteneur sous-jacent de l'adaptateur de rservoir partir d'une varit de sources de donnes .
Original:
Constructs new underlying container of the container adaptor from a variety of data sources.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1)
Copie-construit le rcipient sous-jacent c avec le contenu de cont. C'est aussi le (avant C++11) constructeur par dfaut
Original:
Copy-constructs the underlying container c with the contents of cont. This is also the default constructor (avant C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Dplacez-construit le conteneur sous-jacent c avec std::move(cont). C'est aussi le (depuis C++11) constructeur par dfaut
Original:
Move-constructs the underlying container c with std::move(cont). This is also the default constructor (depuis C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
3)
Copiez constructeur. L'adaptateur est construit avec la copie du contenu de other.c. (implicitement dclar)
Original:
Copy constructor. The adaptor is copy-constructed with the contents of other.c. (implicitement dclar)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
Dplacez constructeur. L'adaptateur est construit avec std::move(other.c). (implicitement dclar)
Original:
Move constructor. The adaptor is constructed with std::move(other.c). (implicitement dclar)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5-9)
Les constructeurs suivants ne sont dfinies que si std::uses_allocator<container_type, Alloc>::value == true, qui est, si le conteneur sous-jacent est un conteneur d'allocation-aware (valable pour tous les conteneurs de la bibliothque standard) .
Original:
The following constructors are only defined if std::uses_allocator<container_type, Alloc>::value == true, that is, if the underlying container is an allocator-aware container (true for all standard library containers).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5)
Construit le conteneur sous-jacent l'aide alloc comme allocateur. Appelle effectivement c(alloc) .
Original:
Constructs the underlying container using alloc as allocator. Effectively calls c(alloc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
6)
Construit le rcipient sous-jacent sur le contenu de cont et en utilisant comme alloc allocateur. Appelle effectivement c(cont, alloc) .
Original:
Constructs the underlying container with the contents of cont and using alloc as allocator. Effectively calls c(cont, alloc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7)
Construit le rcipient sous-jacent sur le contenu de cont utilisant une smantique de dplacement tout en utilisant comme alloc allocateur. Appelle effectivement c(std::move(cont), alloc) .
Original:
Constructs the underlying container with the contents of cont using move semantics while utilising alloc as allocator. Effectively calls c(std::move(cont), alloc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
8)
Construit l'adaptateur avec le contenu de other.c et en utilisant comme alloc allocateur. Appelle effectivement c(athor.c, alloc) .
Original:
Constructs the adaptor with the contents of other.c and using alloc as allocator. Effectively calls c(athor.c, alloc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
9)
Construit l'adaptateur avec le contenu de other utilisant une smantique de dplacement tout en utilisant comme alloc allocateur. Appelle effectivement c(std::move(other.c), alloc) .
Original:
Constructs the adaptor with the contents of other using move semantics while utilising alloc as allocator. Effectively calls c(std::move(other.c), alloc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Paramtres

alloc -
allocateur utiliser pour toutes les allocations de mmoire du conteneur sous-jacent
Original:
allocator to use for all memory allocations of the underlying container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
other -
un autre adaptateur de rservoir tre utilis en tant que source pour initialiser le conteneur sous-jacent
Original:
another container adaptor to be used as source to initialize the underlying container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cont -
Rcipient pour tre utilis comme source pour initialiser le conteneur sous-jacent
Original:
container to be used as source to initialize the underlying container
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
first, last -
ventail d'lments initialiser avec
Original:
range of elements to initialize 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
-
Alloc must meet the requirements of Allocator.
-
Container must meet the requirements of Container. The constructors (5-10) are only defined if Container meets the requirements of AllocatorAwareContainer
-
InputIt must meet the requirements of InputIterator.

Complexit

1, 3, 5, 6, 8: linaire ou cont other
Original:
1, 3, 5, 6, 8: linear in cont or other
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2, 4, 7, 9: constante
Original:
2, 4, 7, 9: constant
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemple

#include <queue>
#include <deque>
#include <iostream>

int main()
{
    std::queue<int> c1;
    c1.push(5);
    std::cout << c1.size() << '\n';

    std::queue<int> c2(c1);
    std::cout << c2.size() << '\n';
 
    std::deque<int> deq {3, 1, 4, 1, 5};
    std::queue<int> c3(deq);
    std::cout << c3.size() << '\n';
}

Rsultat :

1
1
5

Voir aussi

Attribue les valeurs dans l'adaptateur de conteneur
(fonction membre publique) [edit]

Web Proxy Viewer  |  New URL  |  Original Page