| 71 | } // namespace pybind11_tests |
| 72 | |
| 73 | TEST_SUBMODULE(class_sh_factory_constructors, m) { |
| 74 | using namespace pybind11_tests::class_sh_factory_constructors; |
| 75 | |
| 76 | py::classh<atyp_valu>(m, "atyp_valu") |
| 77 | .def(py::init(&rtrn_valu)) |
| 78 | .def("get_mtxt", get_mtxt<atyp_valu>); |
| 79 | |
| 80 | py::classh<atyp_rref>(m, "atyp_rref") |
| 81 | .def(py::init(&rtrn_rref)) |
| 82 | .def("get_mtxt", get_mtxt<atyp_rref>); |
| 83 | |
| 84 | py::classh<atyp_cref>(m, "atyp_cref") |
| 85 | // class_: ... must return a compatible ... |
| 86 | // classh: ... cannot pass object of non-trivial type ... |
| 87 | // .def(py::init(&rtrn_cref)) |
| 88 | .def("get_mtxt", get_mtxt<atyp_cref>); |
| 89 | |
| 90 | py::classh<atyp_mref>(m, "atyp_mref") |
| 91 | // class_: ... must return a compatible ... |
| 92 | // classh: ... cannot pass object of non-trivial type ... |
| 93 | // .def(py::init(&rtrn_mref)) |
| 94 | .def("get_mtxt", get_mtxt<atyp_mref>); |
| 95 | |
| 96 | py::classh<atyp_cptr>(m, "atyp_cptr") |
| 97 | // class_: ... must return a compatible ... |
| 98 | // classh: ... must return a compatible ... |
| 99 | // .def(py::init(&rtrn_cptr)) |
| 100 | .def("get_mtxt", get_mtxt<atyp_cptr>); |
| 101 | |
| 102 | py::classh<atyp_mptr>(m, "atyp_mptr") |
| 103 | .def(py::init(&rtrn_mptr)) |
| 104 | .def("get_mtxt", get_mtxt<atyp_mptr>); |
| 105 | |
| 106 | py::classh<atyp_shmp>(m, "atyp_shmp") |
| 107 | .def(py::init(&rtrn_shmp)) |
| 108 | .def("get_mtxt", get_mtxt<atyp_shmp>); |
| 109 | |
| 110 | py::classh<atyp_shcp>(m, "atyp_shcp") |
| 111 | .def(py::init(&rtrn_shcp)) |
| 112 | .def("get_mtxt", get_mtxt<atyp_shcp>); |
| 113 | |
| 114 | py::classh<atyp_uqmp>(m, "atyp_uqmp") |
| 115 | .def(py::init(&rtrn_uqmp)) |
| 116 | .def("get_mtxt", get_mtxt<atyp_uqmp>); |
| 117 | |
| 118 | py::classh<atyp_uqcp>(m, "atyp_uqcp") |
| 119 | .def(py::init(&rtrn_uqcp)) |
| 120 | .def("get_mtxt", get_mtxt<atyp_uqcp>); |
| 121 | |
| 122 | py::classh<atyp_udmp>(m, "atyp_udmp") |
| 123 | .def(py::init(&rtrn_udmp)) |
| 124 | .def("get_mtxt", get_mtxt<atyp_udmp>); |
| 125 | |
| 126 | py::classh<atyp_udcp>(m, "atyp_udcp") |
| 127 | .def(py::init(&rtrn_udcp)) |
| 128 | .def("get_mtxt", get_mtxt<atyp_udcp>); |
| 129 | |
| 130 | py::classh<with_alias, with_alias_alias>(m, "with_alias") |