MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / emplace_back

Method emplace_back

base_code/template.cpp:247–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246 template<typename... Types>
247 void emplace_back(Types&&... args)
248 {
249 if (full()) {
250 expand();
251 }
252 // 1. 引用折叠 &+&& => &, &&+&& => &&
253 // 2. 类型完美转发 forward
254 _allocator.construct(_last, std::forward<Types>(args)...);
255 ++ _last;
256 }
257
258 void pop_back() // 从容器末尾删除元素
259 {

Callers 2

mainFunction · 0.80
mainFunction · 0.80

Calls 1

constructMethod · 0.80

Tested by

no test coverage detected