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

std::stack::stack cppreference.com
cppreference.com
Namensrume
Varianten

std::stack::stack

Aus cppreference.com

<metanoindex/>

 
 
 
std :: stack
Member-Funktionen
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.
stack::stack
stack::~stack
stack::operator=
Elementzugriff zerstrt
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.
stack::top
Kapazitt
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
stack::empty
stack::size
Modifiers
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
stack::push
stack::emplace
stack::pop
stack::swap
 
<tbody> </tbody>
explicit stack( const Container& cont = Container() ); explicit stack( const Container& cont );
(1) (bis C + +11)
(seit C++11)
explicit stack( Container&& cont = Container() );
(2) (seit C++11)
stack( const stack& other );
(3)
stack( stack&& other );
(4) (seit C++11)
template< class Alloc > explicit stack( const Alloc& alloc );
(5) (seit C++11)
template< class Alloc > stack( const Container& cont, const Alloc& alloc );
(6) (seit C++11)
template< class Alloc > stack( Container&& cont, const Alloc& alloc );
(7) (seit C++11)
template< class Alloc > stack( const stack& other, const Alloc& alloc );
(8) (seit C++11)
template< class Alloc > stack( stack&& other, const Alloc& alloc );
(9) (seit C++11)
Konstrukte neue darunterliegenden Behlter des Behlters Adapter aus einer Vielzahl von Datenquellen .
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)
Kopiergeschtzte konstruiert den darunterliegenden Behlter c mit dem Inhalt cont. Dies ist auch die Default-Konstruktor (bis C + +11)
Original:
Copy-constructs the underlying container c with the contents of cont. This is also the default constructor (bis 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)
Move-baut der zugrunde liegenden Container c mit std::move(cont). Dies ist auch die Default-Konstruktor (seit C++11)
Original:
Move-constructs the underlying container c with std::move(cont). This is also the default constructor (seit 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)
Kopieren Konstruktor. Der Adapter ist mit dem Inhalt des other.c kopiergeschtzten konstruiert. (implizit deklariert)
Original:
Copy constructor. The adaptor is copy-constructed with the contents of other.c. (implizit deklariert)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4)
Bewegen Konstruktor. Der Adapter ist mit std::move(other.c) gebaut. (implizit deklariert)
Original:
Move constructor. The adaptor is constructed with std::move(other.c). (implizit deklariert)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
5-9)
Die folgenden Konstruktoren nur wenn std::uses_allocator<container_type, Alloc>::value == true, das heit wenn der Basiswert Behlter eine Zuordner-fhigen Behlter (gilt fr alle Standard-Bibliothek Behltern) ist definiert .
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)
Konstruiert den zugrunde liegenden Container mit alloc als Allocator. Effektiv nennt 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)
Konstruiert den darunterliegenden Behlter mit dem Inhalt und die Verwendung cont alloc als Zuordner. Effektiv nennt 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)
Konstruiert den darunterliegenden Behlter mit dem Inhalt unter Verwendung cont bewegen Semantik unter Ausnutzung alloc als Zuordner. Effektiv nennt 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)
Konstrukte den Adapter mit dem Inhalt und die Verwendung other.c alloc als Zuordner. Effektiv nennt 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)
Konstruiert den Adapter mit dem Inhalt der other mit move-Semantik unter Ausnutzung alloc als Allocator. Effektiv nennt 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.

Parameter

alloc -
allocator fr alle Speicherzuordnungen des zugrunde liegenden Behlter
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 -
ein weiterer Container Adapter als Quelle, um den darunter liegenden Behlter zu initialisieren verwendet werden
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 -
Behlter zu der als Quelle fr die darunterliegenden Behlter zu initialisieren verwendet werden
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 -
Bereich von Elementen mit initialisieren
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.

Komplexitt

1, 3, 5, 6, 8: linear in cont oder 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: Konstante
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.

Beispiel

#include <stack>
#include <deque>
#include <iostream>

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

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

Output:

1
1
5

Siehe auch

weist Werte auf den Behlter-Adapter
Original:
assigns values to the container adaptor
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(ffentliche Elementfunktion) [edit]

Web Proxy Viewer  |  New URL  |  Original Page