共用方式為


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

標準樣板程式庫