添加新的第一个元素。
void push_front(value_type val);
备注
成员函数插入带值 val 的元素在控件序列开头。使用它的前面添加另一个元素添加到列表中。
示例
// cliext_list_push_front.cpp
// compile with: /clr
#include <cliext/list>
int main()
{
cliext::list<wchar_t> c1;
c1.push_front(L'a');
c1.push_front(L'b');
c1.push_front(L'c');
// display contents " c b a"
for each (wchar_t elem in c1)
System::Console::Write(" {0}", elem);
System::Console::WriteLine();
return (0);
}
要求
标题: <cliext/列表>
命名空间: cliext