다음을 통해 공유


stack::value_type

요소는 스택에 저장 된 개체 유형을 나타내는 형식.

typedef typename Container::value_type value_type;

설명

종류는 동일 value_type 스택에서 채택 기본 컨테이너입니다.

예제

// 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;
}
  

요구 사항

헤더: <stack>

네임 스페이스: std

참고 항목

참조

stack Class

표준 템플릿 라이브러리