mirror of
https://github.com/pybind/pybind11.git
synced 2026-06-06 07:51:47 +00:00
refactor: module -> module_ with typedef (#2544)
* WIP: module -> module_ without typedef * refactor: allow py::module to work again
This commit is contained in:
@@ -26,8 +26,8 @@ productively.
|
||||
Instead, see the "How can I reduce the build time?" question in the "Frequently asked questions"
|
||||
section of the documentation for good practice on splitting binding code over multiple files.
|
||||
*/
|
||||
std::list<std::function<void(py::module &)>> &initializers() {
|
||||
static std::list<std::function<void(py::module &)>> inits;
|
||||
std::list<std::function<void(py::module_ &)>> &initializers() {
|
||||
static std::list<std::function<void(py::module_ &)>> inits;
|
||||
return inits;
|
||||
}
|
||||
|
||||
@@ -36,13 +36,13 @@ test_initializer::test_initializer(Initializer init) {
|
||||
}
|
||||
|
||||
test_initializer::test_initializer(const char *submodule_name, Initializer init) {
|
||||
initializers().emplace_back([=](py::module &parent) {
|
||||
initializers().emplace_back([=](py::module_ &parent) {
|
||||
auto m = parent.def_submodule(submodule_name);
|
||||
init(m);
|
||||
});
|
||||
}
|
||||
|
||||
void bind_ConstructorStats(py::module &m) {
|
||||
void bind_ConstructorStats(py::module_ &m) {
|
||||
py::class_<ConstructorStats>(m, "ConstructorStats")
|
||||
.def("alive", &ConstructorStats::alive)
|
||||
.def("values", &ConstructorStats::values)
|
||||
|
||||
Reference in New Issue
Block a user