Udostępnij za pośrednictwem


stack::value_type

Typ, który reprezentuje typ obiektu przechowywane jako elementu w stosie.

typedef typename Container::value_type value_type;

Uwagi

Typ to synonim value_type podstawowego kontenera dostosowany przez stos.

Przykład

// stack_value_type.cpp
// compile with: /EHsc
#include <stack>
#include <iostream>

int main( )
{
   using namespace std;
   // Declares stacks with default deque base container
   stack<int>::value_type AnInt;
   
   AnInt = 69;
   cout << "The value_type is AnInt = " << AnInt << endl;

   stack<int> s1;
   s1.push( AnInt );
   cout << "The element at the top of the stack is "
        << s1.top( ) << "." << endl;
}
  

Wymagania

Nagłówek: <stack>

Obszar nazw: std

Zobacz też

Informacje

stack Class

Standardowa biblioteka szablonu