构造容器适配器对象。
queue();
queue(queue<Value, Container>% right);
queue(queue<Value, Container>^ right);
explicit queue(container_type% wrapped);
参数
right
要复制的对象。包装
使用的包装容器。
备注
构造函数:
queue();
创建一个空的包装容器。使用它指定空的初始控件序列。
构造函数:
queue(queue<Value, Container>% right);
创建一 right.get_container()的副本中包装的容器。将它指定为的复制序列控件由队列对象 right的初始控件序列。
构造函数:
queue(queue<Value, Container>^ right);
创建一 right->get_container()的副本中包装的容器。将它指定为的复制序列控件由队列对象 *right的初始控件序列。
构造函数:
explicit queue(container_type wrapped);
使用现有的容器 wrapped 作为包装容器。使用该构造从现有的容器的一个队列。
示例
// cliext_queue_construct.cpp
// compile with: /clr
#include <cliext/queue>
#include <cliext/list>
typedef cliext::queue<wchar_t> Myqueue;
typedef cliext::list<wchar_t> Mylist;
typedef cliext::queue<wchar_t, Mylist> Myqueue_list;
int main()
{
// construct an empty container
Myqueue c1;
System::Console::WriteLine("size() = {0}", c1.size());
// construct from an underlying container
Mylist v2(5, L'x');
Myqueue_list c2(v2);
for each (wchar_t elem in c2.get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying another container
Myqueue_list c3(c2);
for each (wchar_t elem in c3.get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
// construct by copying another container through handle
Myqueue_list c4(%c2);
for each (wchar_t elem in c4.get_container())
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
要求
标题: <cliext/队列>
命名空间: cliext