priority_queue::generic_value (STL/CLR)
項目的型別為具有泛型介面的容器使用的。
typedef GValue generic_value;
備註
型別描述儲存的項目值為與泛型介面來使用這個樣板容器類別的型別 GValue 的物件。(GValue 是 value_type 或 value_type^ ,如果 value_type 為參考型別)。
範例
// cliext_priority_queue_generic_value.cpp
// compile with: /clr
#include <cliext/queue>
typedef cliext::priority_queue<wchar_t> Mypriority_queue;
int main()
{
Mypriority_queue c1;
c1.push(L'a');
c1.push(L'b');
c1.push(L'c');
// display contents " a b c"
for each (wchar_t elem in c1.get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// get interface to container
Mypriority_queue::generic_container^ gc1 = %c1;
for each (wchar_t elem in gc1->get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// display in priority order using generic_value
for (; !gc1->empty(); gc1->pop())
{
Mypriority_queue::generic_value elem = gc1->top();
System::Console::Write(" {0}", elem);
}
System::Console::WriteLine();
return (0);
}
需求
標題: <cliext/佇列>
命名空間: cliext