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

Class TestFactory7

tests/test_factory_constructors.cpp:134–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132};
133
134class TestFactory7 {
135protected:
136 int value;
137 bool alias = false;
138
139public:
140 explicit TestFactory7(int i) : value{i} { print_created(this, i); }
141 TestFactory7(TestFactory7 &&f) noexcept {
142 print_move_created(this);
143 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
144 value = f.value;
145 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
146 alias = f.alias;
147 }
148 TestFactory7(const TestFactory7 &f) {
149 print_copy_created(this);
150 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
151 value = f.value;
152 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
153 alias = f.alias;
154 }
155 virtual ~TestFactory7() { print_destroyed(this); }
156 virtual int get() { return value; }
157 bool has_alias() const { return alias; }
158};
159class PyTF7 : public TestFactory7 {
160public:
161 explicit PyTF7(int i) : TestFactory7(i) {

Callers 2

test_init_factory_dualFunction · 0.90
PYBIND11_OVERRIDEFunction · 0.85

Calls

no outgoing calls

Tested by 2

test_init_factory_dualFunction · 0.72
PYBIND11_OVERRIDEFunction · 0.68