共用方式為


priority_queue::to_array (STL/CLR)

複製受控制序列的新陣列。

    cli::array<Value>^ to_array();

備註

成員函式會傳回包含受控制序列的陣列。 您會用它來取得控制序列的陣列形式的複本。

範例

// cliext_priority_queue_to_array.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'); 
 
// copy the container and modify it 
    cli::array<wchar_t>^ a1 = c1.to_array(); 
 
    c1.push(L'd'); 
    for each (wchar_t elem in c1.get_container()) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
 
// display the earlier array copy 
    for each (wchar_t elem in a1) 
        System::Console::Write(" {0}", elem); 
    System::Console::WriteLine(); 
    return (0); 
    } 
 
  

需求

標題: <cliext/佇列>

命名空間: cliext

請參閱

參考

priority_queue (STL/CLR)