priority_queue::generic_value (STL/CLR)

一个元素的类型用于泛型接口的使用容器的。

    typedef GValue generic_value;

备注

类型描述描述存储元素值用于泛型接口的使用此模板容器类的类型 GValue 的对象。 (GValue 是 value_type 或 value_type^ ,如果 value_type 是 ref 类型。)

示例

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

请参见

参考

priority_queue (STL/CLR)

priority_queue::generic_container (STL/CLR)

priority_queue::value_type (STL/CLR)