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

Method Create

tests/test_vector_unique_ptr_member.cpp:14–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12// Reduced from a use case in the wild.
13struct VectorOwner {
14 static std::unique_ptr<VectorOwner> Create(std::size_t num_elems) {
15 return std::unique_ptr<VectorOwner>(
16 new VectorOwner(std::vector<std::unique_ptr<DataType>>(num_elems)));
17 }
18
19 std::size_t data_size() const { return data_.size(); }
20

Callers 2

test_createFunction · 0.80
test_castFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected