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

Method construct

base_code/template.cpp:139–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 void construct(T *p, const T &val) // 负责对象构造
140 {
141 new (p) T(val); // 定位 new: 在地址 p 创建值为 val 的对象
142 }
143
144 template<typename... Types> // 接受不定参的构造方法
145 void construct(T* ptr, Types&&... args)

Callers 5

VectorMethod · 0.80
VectorClass · 0.80
push_backMethod · 0.80
emplace_backMethod · 0.80
expandMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected