MCPcopy Create free account
hub / github.com/pybind/pybind11 / emplace_back

Method emplace_back

include/pybind11/detail/argument_vector.h:173–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171
172 template <typename... Args>
173 void emplace_back(Args &&...x) {
174 if (is_inline()) {
175 auto &ha = m_repr.iarray;
176 if (ha.size == InlineSize) {
177 move_to_heap_vector_with_reserved_size(InlineSize + 1);
178 m_repr.hvector.vec.emplace_back(std::forward<Args>(x)...);
179 } else {
180 ha.arr[ha.size++] = T(std::forward<Args>(x)...);
181 }
182 } else {
183 m_repr.hvector.vec.emplace_back(std::forward<Args>(x)...);
184 }
185 }
186
187 void reserve(std::size_t sz) {
188 if (is_inline()) {

Callers 15

DataFieldsHolderMethod · 0.80
TEST_SUBMODULEFunction · 0.80
TEST_SUBMODULEFunction · 0.80
one_to_nFunction · 0.80
TEST_SUBMODULEFunction · 0.80
create_zooFunction · 0.80
MySingletonClass · 0.80
appendMethod · 0.80
TEST_SUBMODULEFunction · 0.80
test_initializerMethod · 0.80
get_sample_vectorsFunction · 0.80

Calls 1

is_inlineFunction · 0.85

Tested by 10

DataFieldsHolderMethod · 0.64
TEST_SUBMODULEFunction · 0.64
TEST_SUBMODULEFunction · 0.64
one_to_nFunction · 0.64
TEST_SUBMODULEFunction · 0.64
create_zooFunction · 0.64
appendMethod · 0.64
TEST_SUBMODULEFunction · 0.64
test_initializerMethod · 0.64
get_sample_vectorsFunction · 0.64