在线文档教程
C++
容器 | Containers

std::list::push_front

STD::列表::推[医]前部

void push_front( const T& value
void push_front( T&& value (since C++11)

准备给定的元素value到容器的开头。

没有迭代器或引用无效。

参数

value-the value of the element to prepend

返回值

%280%29

复杂性

常量。

例外

如果引发异常,则此函数不具有%28强异常保证%29的效果。

另见

emplace_front (C++11)constructs an element in-place at the beginning (public member function)
push_backadds an element to the end (public member function)
pop_frontremoves the first element (public member function)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/容器/list/Push[医]前部