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

Class TestFactory6

tests/test_factory_constructors.cpp:87–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85};
86
87class TestFactory6 {
88protected:
89 int value;
90 bool alias = false;
91
92public:
93 explicit TestFactory6(int i) : value{i} { print_created(this, i); }
94 TestFactory6(TestFactory6 &&f) noexcept {
95 print_move_created(this);
96 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
97 value = f.value;
98 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
99 alias = f.alias;
100 }
101 TestFactory6(const TestFactory6 &f) {
102 print_copy_created(this);
103 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
104 value = f.value;
105 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
106 alias = f.alias;
107 }
108 virtual ~TestFactory6() { print_destroyed(this); }
109 virtual int get() { return value; }
110 bool has_alias() const { return alias; }
111};
112class PyTF6 : public TestFactory6 {
113public:
114 // Special constructor that allows the factory to construct a PyTF6 from a TestFactory6 only

Callers 1

PYBIND11_OVERRIDEFunction · 0.85

Calls

no outgoing calls

Tested by 1

PYBIND11_OVERRIDEFunction · 0.68