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

std::queue::emplace

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

?

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

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

?

(since C++17)

将新元素推入队列的末尾。元素是就地构造的,即不执行复制或移动操作。调用元素的构造函数的参数与提供给函数的参数完全相同。

有效呼叫return c.emplace_back(std::forward<Args>(args)...);

参数

args

-

arguments to forward to the constructor of the element

返回值

(none)

(until C++17)

A reference to the new element.

(since C++17)

复杂性

与…的复杂性相同Container::emplace_back...

另见

push

inserts element at the end (public member function)

pop

removes the first element (public member function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com