首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::list::emplace_front

template< class... Args > void emplace_front( Args&&... args );

(since C++11) (until C++17)

template< class... Args > reference emplace_front( Args&&... args );

(since C++17)

将新元素插入容器的开头。元素是通过std::allocator_traits::construct,它通常使用Plant-New来在容器提供的位置构造就地元素。争论args...被转发给构造函数的std::forward<Args>(args)......

没有迭代器或引用无效。

参数

args

-

arguments to forward to the constructor of the element

类型要求

-T%28容器%27s元素类型%29必须满足EmplaceConstrucable的要求。

返回值

(none)

(until C++17)

A reference to the inserted element.

(since C++17)

复杂性

常量。

例外

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

另见

push_front

inserts an element to the beginning (public member function)

代码语言:txt
复制
 © cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券