From 6ae889c4a46c36f03c56c5611da995dd991587f3 Mon Sep 17 00:00:00 2001 From: Lucas Czech Date: Fri, 25 Jul 2025 15:47:15 +0200 Subject: [PATCH] Update test references --- test/T00.basic.ref.cpp | 18 +- test/T01.enum.ref.cpp | 14 +- test/T02.function.ref.cpp | 10 +- test/T05.default.ref.cpp | 10 +- test/T07.class.match_args.ref.cpp | 10 +- test/T07.class.ref.cpp | 10 +- test/T08.constructor.ref.cpp | 10 +- test/T09.overload.ref.cpp | 16 +- test/T10.inheritance.ref.cpp | 32 +- test/T10.virtual_inheritance.ref.cpp | 26 +- test/T11.override.ref.cpp | 20 +- test/T12.insertion_operator.ref.cpp | 26 +- test/T12.operator.ref.cpp | 10 +- test/T15.copy.ref.cpp | 10 +- test/T15.inner_class.fwd.ref.cpp | 12 +- test/T15.inner_class.ref.cpp | 28 +- test/T17.anonymous.ref.cpp | 10 +- test/T20.template.ref.cpp | 10 +- test/T20.template.variadic.ref.cpp | 138 +++---- test/T30.include.ref.cpp | 18 +- test/T31.include_for_class.ref.cpp | 14 +- test/T32.call_guard.ref.cpp | 10 +- test/T33.buffer_protocol.ref.cpp | 10 +- test/T40.stl.ref.cpp | 23 +- test/T42.stl.names.map.ref.cpp | 355 +++++++++---------- test/T42.stl.names.multi.ref.cpp | 343 +++++++++--------- test/T42.stl.names.multimap.ref.cpp | 244 +++++++------ test/T42.stl.names.multiset.ref.cpp | 50 ++- test/T42.stl.names.ref.cpp | 323 ++++++++--------- test/T42.stl.names.set.ref.cpp | 184 +++++----- test/T43.stl.pybind11_include_stl.ref.cpp | 14 +- test/T50.add_on_binder.ref.cpp | 10 +- test/T50.namespace_binder.ref.cpp | 18 +- test/T60.custom_shared.ref.cpp | 10 +- test/T60.pybind11.ref.cpp | 46 ++- test/T70.module_local.ref.cpp | 14 +- test/T70.options.ref.cpp | 18 +- test/T71.module_local.ref.cpp | 14 +- test/T80.custom_trampoline.ref.cpp | 10 +- test/T81.custom_trampoline_with_args.ref.cpp | 10 +- 40 files changed, 1096 insertions(+), 1062 deletions(-) diff --git a/test/T00.basic.ref.cpp b/test/T00.basic.ref.cpp index aafaa167..b7d5f81f 100644 --- a/test/T00.basic.ref.cpp +++ b/test/T00.basic.ref.cpp @@ -12,8 +12,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -79,8 +79,8 @@ void bind_T00_basic(std::function< pybind11::module &(std::string const &namespa #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -101,8 +101,8 @@ void bind_T00_basic_1(std::function< pybind11::module &(std::string const &names #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -123,7 +123,7 @@ void bind_T00_basic_2(std::function< pybind11::module &(std::string const &names #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T00_basic(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T00_basic_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -147,7 +147,7 @@ PYBIND11_MODULE(T00_basic, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -155,7 +155,7 @@ PYBIND11_MODULE(T00_basic, root_module) { {"", "global"}, {"", "nonlocal"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T01.enum.ref.cpp b/test/T01.enum.ref.cpp index 77ddd5c3..b23b0b14 100644 --- a/test/T01.enum.ref.cpp +++ b/test/T01.enum.ref.cpp @@ -11,8 +11,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -75,8 +75,8 @@ void bind_T01_enum(std::function< pybind11::module &(std::string const &namespac #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -101,7 +101,7 @@ void bind_T01_enum_1(std::function< pybind11::module &(std::string const &namesp #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T01_enum(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T01_enum_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -124,14 +124,14 @@ PYBIND11_MODULE(T01_enum, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "aaaa"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T02.function.ref.cpp b/test/T02.function.ref.cpp index 897683c9..407ab098 100644 --- a/test/T02.function.ref.cpp +++ b/test/T02.function.ref.cpp @@ -22,8 +22,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -156,7 +156,7 @@ void bind_T02_function(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T02_function(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -178,13 +178,13 @@ PYBIND11_MODULE(T02_function, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T05.default.ref.cpp b/test/T05.default.ref.cpp index c45df01e..b2ec0799 100644 --- a/test/T05.default.ref.cpp +++ b/test/T05.default.ref.cpp @@ -12,8 +12,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -78,7 +78,7 @@ void bind_T05_default(std::function< pybind11::module &(std::string const &names #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T05_default(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -100,13 +100,13 @@ PYBIND11_MODULE(T05_default, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T07.class.match_args.ref.cpp b/test/T07.class.match_args.ref.cpp index 868a4b3c..fb5a788a 100644 --- a/test/T07.class.match_args.ref.cpp +++ b/test/T07.class.match_args.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -35,7 +35,7 @@ void bind_T07_class_match_args(std::function< pybind11::module &(std::string con #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T07_class_match_args(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -57,13 +57,13 @@ PYBIND11_MODULE(T07_class_match_args, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T07.class.ref.cpp b/test/T07.class.ref.cpp index 4e722aa6..b35d9635 100644 --- a/test/T07.class.ref.cpp +++ b/test/T07.class.ref.cpp @@ -15,8 +15,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -93,7 +93,7 @@ void bind_T07_class(std::function< pybind11::module &(std::string const &namespa #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T07_class(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -115,13 +115,13 @@ PYBIND11_MODULE(T07_class, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T08.constructor.ref.cpp b/test/T08.constructor.ref.cpp index 1bfb7d15..ead4b87c 100644 --- a/test/T08.constructor.ref.cpp +++ b/test/T08.constructor.ref.cpp @@ -15,8 +15,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -66,7 +66,7 @@ void bind_T08_constructor(std::function< pybind11::module &(std::string const &n #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T08_constructor(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -88,13 +88,13 @@ PYBIND11_MODULE(T08_constructor, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T09.overload.ref.cpp b/test/T09.overload.ref.cpp index 715855fe..941554d4 100644 --- a/test/T09.overload.ref.cpp +++ b/test/T09.overload.ref.cpp @@ -11,8 +11,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -29,7 +29,7 @@ struct PyCallBack_A2 : public A2 { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return A2::f(); } @@ -48,7 +48,7 @@ struct PyCallBack_A3 : public A3 { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"A3::f\""); } @@ -67,7 +67,7 @@ struct PyCallBack_A4 : public A4 { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"A4::assign\""); } @@ -117,7 +117,7 @@ void bind_T09_overload(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T09_overload(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -139,13 +139,13 @@ PYBIND11_MODULE(T09_overload, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T10.inheritance.ref.cpp b/test/T10.inheritance.ref.cpp index 8a9ae8ed..db9a5b49 100644 --- a/test/T10.inheritance.ref.cpp +++ b/test/T10.inheritance.ref.cpp @@ -14,8 +14,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -32,7 +32,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_protected(); } @@ -45,7 +45,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v(); } @@ -58,7 +58,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v_2(); } @@ -77,7 +77,7 @@ struct PyCallBack_Derived : public Derived { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_protected(); } @@ -90,7 +90,7 @@ struct PyCallBack_Derived : public Derived { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v(); } @@ -103,7 +103,7 @@ struct PyCallBack_Derived : public Derived { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v_2(); } @@ -122,7 +122,7 @@ struct PyCallBack_Delete : public Delete { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_protected(); } @@ -135,7 +135,7 @@ struct PyCallBack_Delete : public Delete { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v(); } @@ -148,7 +148,7 @@ struct PyCallBack_Delete : public Delete { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v_2(); } @@ -167,7 +167,7 @@ struct PyCallBack_X : public X { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_protected(); } @@ -180,7 +180,7 @@ struct PyCallBack_X : public X { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::f_v_2(); } @@ -243,7 +243,7 @@ void bind_T10_inheritance(std::function< pybind11::module &(std::string const &n #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T10_inheritance(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -265,13 +265,13 @@ PYBIND11_MODULE(T10_inheritance, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T10.virtual_inheritance.ref.cpp b/test/T10.virtual_inheritance.ref.cpp index 9e7adbe0..1e658c01 100644 --- a/test/T10.virtual_inheritance.ref.cpp +++ b/test/T10.virtual_inheritance.ref.cpp @@ -13,8 +13,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -31,7 +31,7 @@ struct PyCallBack_Animal_1_t : public Animal<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"Animal::Eat\""); } @@ -44,7 +44,7 @@ struct PyCallBack_Animal_1_t : public Animal<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Animal::isDog(); } @@ -63,7 +63,7 @@ struct PyCallBack_Mammal_1_t : public Mammal<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"Mammal::Breathe\""); } @@ -76,7 +76,7 @@ struct PyCallBack_Mammal_1_t : public Mammal<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"Animal::Eat\""); } @@ -89,7 +89,7 @@ struct PyCallBack_Mammal_1_t : public Mammal<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Animal::isDog(); } @@ -108,7 +108,7 @@ struct PyCallBack_Dog_1_t : public Dog<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Dog::Eat(); } @@ -121,7 +121,7 @@ struct PyCallBack_Dog_1_t : public Dog<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Dog::Breathe(); } @@ -134,7 +134,7 @@ struct PyCallBack_Dog_1_t : public Dog<1> { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Dog::isDog(); } @@ -186,7 +186,7 @@ void bind_T10_virtual_inheritance(std::function< pybind11::module &(std::string #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T10_virtual_inheritance(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -208,13 +208,13 @@ PYBIND11_MODULE(T10_virtual_inheritance, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T11.override.ref.cpp b/test/T11.override.ref.cpp index c9c659c7..227ee482 100644 --- a/test/T11.override.ref.cpp +++ b/test/T11.override.ref.cpp @@ -12,8 +12,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -30,7 +30,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_void(); } @@ -43,7 +43,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } pybind11::pybind11_fail("Tried to call pure virtual function \"Base::foo_void_pure\""); } @@ -56,7 +56,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_int(); } @@ -69,7 +69,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_sring(); } @@ -82,7 +82,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo_sring_r(); } @@ -114,7 +114,7 @@ void bind_T11_override(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T11_override(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -136,13 +136,13 @@ PYBIND11_MODULE(T11_override, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T12.insertion_operator.ref.cpp b/test/T12.insertion_operator.ref.cpp index ba9dc8fc..8da8d19c 100644 --- a/test/T12.insertion_operator.ref.cpp +++ b/test/T12.insertion_operator.ref.cpp @@ -14,8 +14,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -46,8 +46,8 @@ void bind_T12_insertion_operator(std::function< pybind11::module &(std::string c #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -79,8 +79,8 @@ void bind_T12_insertion_operator_1(std::function< pybind11::module &(std::string #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -114,8 +114,8 @@ void bind_T12_insertion_operator_2(std::function< pybind11::module &(std::string #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -153,8 +153,8 @@ void bind_T12_insertion_operator_3(std::function< pybind11::module &(std::string #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -178,7 +178,7 @@ void bind_T12_insertion_operator_4(std::function< pybind11::module &(std::string #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T12_insertion_operator(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T12_insertion_operator_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -204,7 +204,7 @@ PYBIND11_MODULE(T12_insertion_operator, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -213,7 +213,7 @@ PYBIND11_MODULE(T12_insertion_operator, root_module) { {"", "bbbb"}, {"bbbb", "cccc"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T12.operator.ref.cpp b/test/T12.operator.ref.cpp index 97c2446b..6a59bf09 100644 --- a/test/T12.operator.ref.cpp +++ b/test/T12.operator.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -64,7 +64,7 @@ void bind_T12_operator(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T12_operator(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -86,13 +86,13 @@ PYBIND11_MODULE(T12_operator, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T15.copy.ref.cpp b/test/T15.copy.ref.cpp index 7dca1ce4..398fa92a 100644 --- a/test/T15.copy.ref.cpp +++ b/test/T15.copy.ref.cpp @@ -14,8 +14,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -61,7 +61,7 @@ void bind_T15_copy(std::function< pybind11::module &(std::string const &namespac #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T15_copy(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -83,13 +83,13 @@ PYBIND11_MODULE(T15_copy, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T15.inner_class.fwd.ref.cpp b/test/T15.inner_class.fwd.ref.cpp index be18616d..db758909 100644 --- a/test/T15.inner_class.fwd.ref.cpp +++ b/test/T15.inner_class.fwd.ref.cpp @@ -10,15 +10,15 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T15_inner_class_fwd(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // outer file:T15.inner_class.fwd.hpp line: - pybind11::class_> cl(M(""), "outer", "binder/test/T15.inner_class.fwd.hpp\n \n\n Binder self-test file. Tests for bindings of forward declared inner functions."); + pybind11::class_> cl(M(""), "outer", "Binder self-test file. Tests for bindings of forward declared inner functions."); cl.def( pybind11::init( [](){ return new outer(); } ) ); cl.def("f", (void (outer::*)(struct outer::inner *, struct outer::inner2 *, struct outer::inner3 *)) &outer::f, "C++: outer::f(struct outer::inner *, struct outer::inner2 *, struct outer::inner3 *) --> void", pybind11::arg("i"), pybind11::arg("i2"), pybind11::arg("i3")); @@ -56,7 +56,7 @@ void bind_T15_inner_class_fwd(std::function< pybind11::module &(std::string cons #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T15_inner_class_fwd(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -78,13 +78,13 @@ PYBIND11_MODULE(T15_inner_class_fwd, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T15.inner_class.ref.cpp b/test/T15.inner_class.ref.cpp index 2ac72741..24171fa6 100644 --- a/test/T15.inner_class.ref.cpp +++ b/test/T15.inner_class.ref.cpp @@ -10,8 +10,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -28,7 +28,7 @@ struct PyCallBack_Base : public Base { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo(); } @@ -85,8 +85,8 @@ void bind_T15_inner_class(std::function< pybind11::module &(std::string const &n #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -103,7 +103,7 @@ struct PyCallBack_n1_A : public n1::A { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo(); } @@ -130,8 +130,8 @@ void bind_T15_inner_class_1(std::function< pybind11::module &(std::string const #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -148,7 +148,7 @@ struct PyCallBack_n1_n2_A : public n1::n2::A { static pybind11::detail::override_caster_t caster; return pybind11::detail::cast_ref(std::move(o), caster); } - else return pybind11::detail::cast_safe(std::move(o)); + return pybind11::detail::cast_safe(std::move(o)); } return Base::foo(); } @@ -174,8 +174,8 @@ void bind_T15_inner_class_2(std::function< pybind11::module &(std::string const #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -196,7 +196,7 @@ void bind_T15_inner_class_3(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T15_inner_class(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T15_inner_class_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -221,7 +221,7 @@ PYBIND11_MODULE(T15_inner_class, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -229,7 +229,7 @@ PYBIND11_MODULE(T15_inner_class, root_module) { {"", "n1"}, {"n1", "n2"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T17.anonymous.ref.cpp b/test/T17.anonymous.ref.cpp index 156d9a74..3ee361cd 100644 --- a/test/T17.anonymous.ref.cpp +++ b/test/T17.anonymous.ref.cpp @@ -13,8 +13,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -71,7 +71,7 @@ void bind_T17_anonymous(std::function< pybind11::module &(std::string const &nam #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T17_anonymous(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -93,13 +93,13 @@ PYBIND11_MODULE(T17_anonymous, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T20.template.ref.cpp b/test/T20.template.ref.cpp index 87a26ea0..bacffde1 100644 --- a/test/T20.template.ref.cpp +++ b/test/T20.template.ref.cpp @@ -14,8 +14,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -83,7 +83,7 @@ void bind_T20_template(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T20_template(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -105,13 +105,13 @@ PYBIND11_MODULE(T20_template, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T20.template.variadic.ref.cpp b/test/T20.template.variadic.ref.cpp index 849249a0..b48a7199 100644 --- a/test/T20.template.variadic.ref.cpp +++ b/test/T20.template.variadic.ref.cpp @@ -9,48 +9,48 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_std_array(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // std::array file:array line: - pybind11::class_,2>, std::shared_ptr,2>>> cl(M("std"), "array_variadic_template_Array_int_2_2_t", ""); - cl.def( pybind11::init( [](){ return new std::array,2>(); } ) ); - cl.def("fill", (void (std::array,2>::*)(const struct variadic_template::Array &)) &std::array, 2>::fill, "C++: std::array, 2>::fill(const struct variadic_template::Array &) --> void", pybind11::arg("__u")); - cl.def("swap", (void (std::array,2>::*)(struct std::array, 2> &)) &std::array, 2>::swap, "C++: std::array, 2>::swap(struct std::array, 2> &) --> void", pybind11::arg("__other")); - cl.def("begin", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::begin, "C++: std::array, 2>::begin() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("end", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::end, "C++: std::array, 2>::end() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("cbegin", (const struct variadic_template::Array * (std::array,2>::*)() const) &std::array, 2>::cbegin, "C++: std::array, 2>::cbegin() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("cend", (const struct variadic_template::Array * (std::array,2>::*)() const) &std::array, 2>::cend, "C++: std::array, 2>::cend() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("size", (unsigned long (std::array,2>::*)() const) &std::array, 2>::size, "C++: std::array, 2>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::array,2>::*)() const) &std::array, 2>::max_size, "C++: std::array, 2>::max_size() const --> unsigned long"); - cl.def("empty", (bool (std::array,2>::*)() const) &std::array, 2>::empty, "C++: std::array, 2>::empty() const --> bool"); - cl.def("__getitem__", (struct variadic_template::Array & (std::array,2>::*)(unsigned long)) &std::array, 2>::operator[], "C++: std::array, 2>::operator[](unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (struct variadic_template::Array & (std::array,2>::*)(unsigned long)) &std::array, 2>::at, "C++: std::array, 2>::at(unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (struct variadic_template::Array & (std::array,2>::*)()) &std::array, 2>::front, "C++: std::array, 2>::front() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); - cl.def("back", (struct variadic_template::Array & (std::array,2>::*)()) &std::array, 2>::back, "C++: std::array, 2>::back() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); - cl.def("data", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::data, "C++: std::array, 2>::data() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + pybind11::class_,2UL>, std::shared_ptr,2UL>>> cl(M("std"), "array_variadic_template_Array_int_2_2UL_t", ""); + cl.def( pybind11::init( [](){ return new std::array,2UL>(); } ) ); + cl.def("fill", (void (std::array,2UL>::*)(const struct variadic_template::Array &)) &std::array, 2>::fill, "C++: std::array, 2>::fill(const struct variadic_template::Array &) --> void", pybind11::arg("__u")); + cl.def("swap", (void (std::array,2UL>::*)(struct std::array, 2> &)) &std::array, 2>::swap, "C++: std::array, 2>::swap(struct std::array, 2> &) --> void", pybind11::arg("__other")); + cl.def("begin", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::begin, "C++: std::array, 2>::begin() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("end", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::end, "C++: std::array, 2>::end() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("cbegin", (const struct variadic_template::Array * (std::array,2UL>::*)() const) &std::array, 2>::cbegin, "C++: std::array, 2>::cbegin() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("cend", (const struct variadic_template::Array * (std::array,2UL>::*)() const) &std::array, 2>::cend, "C++: std::array, 2>::cend() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("size", (unsigned long (std::array,2UL>::*)() const) &std::array, 2>::size, "C++: std::array, 2>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::array,2UL>::*)() const) &std::array, 2>::max_size, "C++: std::array, 2>::max_size() const --> unsigned long"); + cl.def("empty", (bool (std::array,2UL>::*)() const) &std::array, 2>::empty, "C++: std::array, 2>::empty() const --> bool"); + cl.def("__getitem__", (struct variadic_template::Array & (std::array,2UL>::*)(unsigned long)) &std::array, 2>::operator[], "C++: std::array, 2>::operator[](unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (struct variadic_template::Array & (std::array,2UL>::*)(unsigned long)) &std::array, 2>::at, "C++: std::array, 2>::at(unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (struct variadic_template::Array & (std::array,2UL>::*)()) &std::array, 2>::front, "C++: std::array, 2>::front() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); + cl.def("back", (struct variadic_template::Array & (std::array,2UL>::*)()) &std::array, 2>::back, "C++: std::array, 2>::back() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); + cl.def("data", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::data, "C++: std::array, 2>::data() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); } { // std::array file:array line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "array_int_2_t", ""); - cl.def( pybind11::init( [](){ return new std::array(); } ) ); - cl.def("fill", (void (std::array::*)(const int &)) &std::array::fill, "C++: std::array::fill(const int &) --> void", pybind11::arg("__u")); - cl.def("swap", (void (std::array::*)(struct std::array &)) &std::array::swap, "C++: std::array::swap(struct std::array &) --> void", pybind11::arg("__other")); - cl.def("begin", (int * (std::array::*)()) &std::array::begin, "C++: std::array::begin() --> int *", pybind11::return_value_policy::automatic); - cl.def("end", (int * (std::array::*)()) &std::array::end, "C++: std::array::end() --> int *", pybind11::return_value_policy::automatic); - cl.def("cbegin", (const int * (std::array::*)() const) &std::array::cbegin, "C++: std::array::cbegin() const --> const int *", pybind11::return_value_policy::automatic); - cl.def("cend", (const int * (std::array::*)() const) &std::array::cend, "C++: std::array::cend() const --> const int *", pybind11::return_value_policy::automatic); - cl.def("size", (unsigned long (std::array::*)() const) &std::array::size, "C++: std::array::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::array::*)() const) &std::array::max_size, "C++: std::array::max_size() const --> unsigned long"); - cl.def("empty", (bool (std::array::*)() const) &std::array::empty, "C++: std::array::empty() const --> bool"); - cl.def("__getitem__", (int & (std::array::*)(unsigned long)) &std::array::operator[], "C++: std::array::operator[](unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (int & (std::array::*)(unsigned long)) &std::array::at, "C++: std::array::at(unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (int & (std::array::*)()) &std::array::front, "C++: std::array::front() --> int &", pybind11::return_value_policy::automatic); - cl.def("back", (int & (std::array::*)()) &std::array::back, "C++: std::array::back() --> int &", pybind11::return_value_policy::automatic); - cl.def("data", (int * (std::array::*)()) &std::array::data, "C++: std::array::data() --> int *", pybind11::return_value_policy::automatic); + pybind11::class_, std::shared_ptr>> cl(M("std"), "array_int_2UL_t", ""); + cl.def( pybind11::init( [](){ return new std::array(); } ) ); + cl.def("fill", (void (std::array::*)(const int &)) &std::array::fill, "C++: std::array::fill(const int &) --> void", pybind11::arg("__u")); + cl.def("swap", (void (std::array::*)(struct std::array &)) &std::array::swap, "C++: std::array::swap(struct std::array &) --> void", pybind11::arg("__other")); + cl.def("begin", (int * (std::array::*)()) &std::array::begin, "C++: std::array::begin() --> int *", pybind11::return_value_policy::automatic); + cl.def("end", (int * (std::array::*)()) &std::array::end, "C++: std::array::end() --> int *", pybind11::return_value_policy::automatic); + cl.def("cbegin", (const int * (std::array::*)() const) &std::array::cbegin, "C++: std::array::cbegin() const --> const int *", pybind11::return_value_policy::automatic); + cl.def("cend", (const int * (std::array::*)() const) &std::array::cend, "C++: std::array::cend() const --> const int *", pybind11::return_value_policy::automatic); + cl.def("size", (unsigned long (std::array::*)() const) &std::array::size, "C++: std::array::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::array::*)() const) &std::array::max_size, "C++: std::array::max_size() const --> unsigned long"); + cl.def("empty", (bool (std::array::*)() const) &std::array::empty, "C++: std::array::empty() const --> bool"); + cl.def("__getitem__", (int & (std::array::*)(unsigned long)) &std::array::operator[], "C++: std::array::operator[](unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (int & (std::array::*)(unsigned long)) &std::array::at, "C++: std::array::at(unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (int & (std::array::*)()) &std::array::front, "C++: std::array::front() --> int &", pybind11::return_value_policy::automatic); + cl.def("back", (int & (std::array::*)()) &std::array::back, "C++: std::array::back() --> int &", pybind11::return_value_policy::automatic); + cl.def("data", (int * (std::array::*)()) &std::array::data, "C++: std::array::data() --> int *", pybind11::return_value_policy::automatic); } } @@ -66,48 +66,48 @@ void bind_std_array(std::function< pybind11::module &(std::string const &namespa #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T20_template_variadic(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // variadic_template::Array file:T20.template.variadic.hpp line: - pybind11::class_, std::shared_ptr>, std::array,2>> cl(M("variadic_template"), "Array_int_2_2_t", ""); + pybind11::class_, std::shared_ptr>, std::array,2UL>> cl(M("variadic_template"), "Array_int_2_2_t", ""); cl.def( pybind11::init( [](){ return new variadic_template::Array(); } ) ); - cl.def("fill", (void (std::array,2>::*)(const struct variadic_template::Array &)) &std::array, 2>::fill, "C++: std::array, 2>::fill(const struct variadic_template::Array &) --> void", pybind11::arg("__u")); - cl.def("swap", (void (std::array,2>::*)(struct std::array, 2> &)) &std::array, 2>::swap, "C++: std::array, 2>::swap(struct std::array, 2> &) --> void", pybind11::arg("__other")); - cl.def("begin", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::begin, "C++: std::array, 2>::begin() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("end", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::end, "C++: std::array, 2>::end() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("cbegin", (const struct variadic_template::Array * (std::array,2>::*)() const) &std::array, 2>::cbegin, "C++: std::array, 2>::cbegin() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("cend", (const struct variadic_template::Array * (std::array,2>::*)() const) &std::array, 2>::cend, "C++: std::array, 2>::cend() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); - cl.def("size", (unsigned long (std::array,2>::*)() const) &std::array, 2>::size, "C++: std::array, 2>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::array,2>::*)() const) &std::array, 2>::max_size, "C++: std::array, 2>::max_size() const --> unsigned long"); - cl.def("empty", (bool (std::array,2>::*)() const) &std::array, 2>::empty, "C++: std::array, 2>::empty() const --> bool"); - cl.def("__getitem__", (struct variadic_template::Array & (std::array,2>::*)(unsigned long)) &std::array, 2>::operator[], "C++: std::array, 2>::operator[](unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (struct variadic_template::Array & (std::array,2>::*)(unsigned long)) &std::array, 2>::at, "C++: std::array, 2>::at(unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (struct variadic_template::Array & (std::array,2>::*)()) &std::array, 2>::front, "C++: std::array, 2>::front() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); - cl.def("back", (struct variadic_template::Array & (std::array,2>::*)()) &std::array, 2>::back, "C++: std::array, 2>::back() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); - cl.def("data", (struct variadic_template::Array * (std::array,2>::*)()) &std::array, 2>::data, "C++: std::array, 2>::data() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("fill", (void (std::array,2UL>::*)(const struct variadic_template::Array &)) &std::array, 2>::fill, "C++: std::array, 2>::fill(const struct variadic_template::Array &) --> void", pybind11::arg("__u")); + cl.def("swap", (void (std::array,2UL>::*)(struct std::array, 2> &)) &std::array, 2>::swap, "C++: std::array, 2>::swap(struct std::array, 2> &) --> void", pybind11::arg("__other")); + cl.def("begin", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::begin, "C++: std::array, 2>::begin() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("end", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::end, "C++: std::array, 2>::end() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("cbegin", (const struct variadic_template::Array * (std::array,2UL>::*)() const) &std::array, 2>::cbegin, "C++: std::array, 2>::cbegin() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("cend", (const struct variadic_template::Array * (std::array,2UL>::*)() const) &std::array, 2>::cend, "C++: std::array, 2>::cend() const --> const struct variadic_template::Array *", pybind11::return_value_policy::automatic); + cl.def("size", (unsigned long (std::array,2UL>::*)() const) &std::array, 2>::size, "C++: std::array, 2>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::array,2UL>::*)() const) &std::array, 2>::max_size, "C++: std::array, 2>::max_size() const --> unsigned long"); + cl.def("empty", (bool (std::array,2UL>::*)() const) &std::array, 2>::empty, "C++: std::array, 2>::empty() const --> bool"); + cl.def("__getitem__", (struct variadic_template::Array & (std::array,2UL>::*)(unsigned long)) &std::array, 2>::operator[], "C++: std::array, 2>::operator[](unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (struct variadic_template::Array & (std::array,2UL>::*)(unsigned long)) &std::array, 2>::at, "C++: std::array, 2>::at(unsigned long) --> struct variadic_template::Array &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (struct variadic_template::Array & (std::array,2UL>::*)()) &std::array, 2>::front, "C++: std::array, 2>::front() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); + cl.def("back", (struct variadic_template::Array & (std::array,2UL>::*)()) &std::array, 2>::back, "C++: std::array, 2>::back() --> struct variadic_template::Array &", pybind11::return_value_policy::automatic); + cl.def("data", (struct variadic_template::Array * (std::array,2UL>::*)()) &std::array, 2>::data, "C++: std::array, 2>::data() --> struct variadic_template::Array *", pybind11::return_value_policy::automatic); } { // variadic_template::Array file:T20.template.variadic.hpp line: - pybind11::class_, std::shared_ptr>, std::array> cl(M("variadic_template"), "Array_int_2_t", ""); + pybind11::class_, std::shared_ptr>, std::array> cl(M("variadic_template"), "Array_int_2_t", ""); cl.def( pybind11::init( [](){ return new variadic_template::Array(); } ) ); - cl.def("fill", (void (std::array::*)(const int &)) &std::array::fill, "C++: std::array::fill(const int &) --> void", pybind11::arg("__u")); - cl.def("swap", (void (std::array::*)(struct std::array &)) &std::array::swap, "C++: std::array::swap(struct std::array &) --> void", pybind11::arg("__other")); - cl.def("begin", (int * (std::array::*)()) &std::array::begin, "C++: std::array::begin() --> int *", pybind11::return_value_policy::automatic); - cl.def("end", (int * (std::array::*)()) &std::array::end, "C++: std::array::end() --> int *", pybind11::return_value_policy::automatic); - cl.def("cbegin", (const int * (std::array::*)() const) &std::array::cbegin, "C++: std::array::cbegin() const --> const int *", pybind11::return_value_policy::automatic); - cl.def("cend", (const int * (std::array::*)() const) &std::array::cend, "C++: std::array::cend() const --> const int *", pybind11::return_value_policy::automatic); - cl.def("size", (unsigned long (std::array::*)() const) &std::array::size, "C++: std::array::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::array::*)() const) &std::array::max_size, "C++: std::array::max_size() const --> unsigned long"); - cl.def("empty", (bool (std::array::*)() const) &std::array::empty, "C++: std::array::empty() const --> bool"); - cl.def("__getitem__", (int & (std::array::*)(unsigned long)) &std::array::operator[], "C++: std::array::operator[](unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (int & (std::array::*)(unsigned long)) &std::array::at, "C++: std::array::at(unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (int & (std::array::*)()) &std::array::front, "C++: std::array::front() --> int &", pybind11::return_value_policy::automatic); - cl.def("back", (int & (std::array::*)()) &std::array::back, "C++: std::array::back() --> int &", pybind11::return_value_policy::automatic); - cl.def("data", (int * (std::array::*)()) &std::array::data, "C++: std::array::data() --> int *", pybind11::return_value_policy::automatic); + cl.def("fill", (void (std::array::*)(const int &)) &std::array::fill, "C++: std::array::fill(const int &) --> void", pybind11::arg("__u")); + cl.def("swap", (void (std::array::*)(struct std::array &)) &std::array::swap, "C++: std::array::swap(struct std::array &) --> void", pybind11::arg("__other")); + cl.def("begin", (int * (std::array::*)()) &std::array::begin, "C++: std::array::begin() --> int *", pybind11::return_value_policy::automatic); + cl.def("end", (int * (std::array::*)()) &std::array::end, "C++: std::array::end() --> int *", pybind11::return_value_policy::automatic); + cl.def("cbegin", (const int * (std::array::*)() const) &std::array::cbegin, "C++: std::array::cbegin() const --> const int *", pybind11::return_value_policy::automatic); + cl.def("cend", (const int * (std::array::*)() const) &std::array::cend, "C++: std::array::cend() const --> const int *", pybind11::return_value_policy::automatic); + cl.def("size", (unsigned long (std::array::*)() const) &std::array::size, "C++: std::array::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::array::*)() const) &std::array::max_size, "C++: std::array::max_size() const --> unsigned long"); + cl.def("empty", (bool (std::array::*)() const) &std::array::empty, "C++: std::array::empty() const --> bool"); + cl.def("__getitem__", (int & (std::array::*)(unsigned long)) &std::array::operator[], "C++: std::array::operator[](unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (int & (std::array::*)(unsigned long)) &std::array::at, "C++: std::array::at(unsigned long) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (int & (std::array::*)()) &std::array::front, "C++: std::array::front() --> int &", pybind11::return_value_policy::automatic); + cl.def("back", (int & (std::array::*)()) &std::array::back, "C++: std::array::back() --> int &", pybind11::return_value_policy::automatic); + cl.def("data", (int * (std::array::*)()) &std::array::data, "C++: std::array::data() --> int *", pybind11::return_value_policy::automatic); } { // variadic_template::st2 file:T20.template.variadic.hpp line: pybind11::class_, variadic_template::Array> cl(M("variadic_template"), "st2", ""); @@ -125,7 +125,7 @@ void bind_T20_template_variadic(std::function< pybind11::module &(std::string co #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_array(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T20_template_variadic(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -148,7 +148,7 @@ PYBIND11_MODULE(T20_template_variadic, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -156,7 +156,7 @@ PYBIND11_MODULE(T20_template_variadic, root_module) { {"", "std"}, {"", "variadic_template"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T30.include.ref.cpp b/test/T30.include.ref.cpp index 033ffbd2..fe5546da 100644 --- a/test/T30.include.ref.cpp +++ b/test/T30.include.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -33,8 +33,8 @@ void bind_T30_include_incl_a_include(std::function< pybind11::module &(std::stri #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -58,8 +58,8 @@ void bind_T30_include_incl_b_include(std::function< pybind11::module &(std::stri #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -80,7 +80,7 @@ void bind_T30_include(std::function< pybind11::module &(std::string const &names #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T30_include_incl_a_include(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T30_include_incl_b_include(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -104,7 +104,7 @@ PYBIND11_MODULE(T30_include, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -112,7 +112,7 @@ PYBIND11_MODULE(T30_include, root_module) { {"", "aaaa"}, {"", "bbbb"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T31.include_for_class.ref.cpp b/test/T31.include_for_class.ref.cpp index e92da95f..b57a28b6 100644 --- a/test/T31.include_for_class.ref.cpp +++ b/test/T31.include_for_class.ref.cpp @@ -14,8 +14,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -41,8 +41,8 @@ void bind_T31_include_for_class_incl_a_include(std::function< pybind11::module & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -64,7 +64,7 @@ void bind_T31_include_for_class_incl_b_include(std::function< pybind11::module & #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T31_include_for_class_incl_a_include(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T31_include_for_class_incl_b_include(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -87,7 +87,7 @@ PYBIND11_MODULE(T31_include_for_class, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -95,7 +95,7 @@ PYBIND11_MODULE(T31_include_for_class, root_module) { {"", "aaaa"}, {"", "bbbb"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T32.call_guard.ref.cpp b/test/T32.call_guard.ref.cpp index 74f1b3d7..02b977e2 100644 --- a/test/T32.call_guard.ref.cpp +++ b/test/T32.call_guard.ref.cpp @@ -9,8 +9,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -36,7 +36,7 @@ void bind_T32_call_guard(std::function< pybind11::module &(std::string const &na #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T32_call_guard(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -58,13 +58,13 @@ PYBIND11_MODULE(T32_call_guard, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T33.buffer_protocol.ref.cpp b/test/T33.buffer_protocol.ref.cpp index af2cd07a..1aa143cd 100644 --- a/test/T33.buffer_protocol.ref.cpp +++ b/test/T33.buffer_protocol.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -31,7 +31,7 @@ void bind_T33_buffer_protocol(std::function< pybind11::module &(std::string cons #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T33_buffer_protocol(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -53,13 +53,13 @@ PYBIND11_MODULE(T33_buffer_protocol, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T40.stl.ref.cpp b/test/T40.stl.ref.cpp index d837bfbf..64831de4 100644 --- a/test/T40.stl.ref.cpp +++ b/test/T40.stl.ref.cpp @@ -12,8 +12,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -39,22 +39,21 @@ void bind_std_stl_vector(std::function< pybind11::module &(std::string const &na #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T40_stl(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::vector >) file:T40.stl.hpp line: - M("").def("foo", (void (*)(class std::vector >)) &foo, "C++: foo(class std::vector >) --> void", pybind11::arg("")); + // foo(class std::vector) file:T40.stl.hpp line: + M("").def("foo", (void (*)(class std::vector)) &foo, "C++: foo(class std::vector) --> void", pybind11::arg("")); } // File: std/T40_stl.cpp #include // __gnu_cxx::__normal_iterator -#include // std::move_iterator #include // std::reverse_iterator #include // std::allocator #include // __str__ @@ -68,8 +67,8 @@ void bind_T40_stl(std::function< pybind11::module &(std::string const &namespace #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -90,7 +89,7 @@ void bind_std_T40_stl(std::function< pybind11::module &(std::string const &names #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_vector(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T40_stl(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -114,14 +113,14 @@ PYBIND11_MODULE(T40_stl, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T42.stl.names.map.ref.cpp b/test/T42.stl.names.map.ref.cpp index 2c109662..59a3bbfc 100644 --- a/test/T42.stl.names.map.ref.cpp +++ b/test/T42.stl.names.map.ref.cpp @@ -1,11 +1,13 @@ // File: std/stl_function.cpp #include // std::binary_function #include // std::equal_to +#include // std::hash #include // __gnu_cxx::__normal_iterator #include // std::allocator #include // __str__ #include // std::basic_string #include // std::char_traits +#include // std::hash #include #include @@ -13,8 +15,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -35,21 +37,35 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_float_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); cl.def("__call__", (bool (std::equal_to::*)(const float &, const float &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const float &, const float &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_std_string_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); - cl.def("__call__", (bool (std::equal_to::*)(const std::string &, const std::string &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const std::string &, const std::string &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); + cl.def("__call__", (bool (std::equal_to::*)(const std::string &, const std::string &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const std::string &, const std::string &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } + { // std::hash file:bits/basic_string.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_std_string_t", ""); + cl.def( pybind11::init( [](){ return new std::hash(); } ) ); + cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); + } + { // std::hash file:bits/functional_hash.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_float_t", ""); + cl.def( pybind11::init( [](){ return new std::hash(); } ) ); + cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); + cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); + } } -// File: std/functional_hash.cpp +// File: std/stl_map.cpp #include // std::deque #include // std::forward_list +#include // std::equal_to #include // std::hash #include // std::less #include // __gnu_cxx::__normal_iterator @@ -61,7 +77,9 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #include // __str__ #include // std::basic_string #include // std::char_traits -#include // std::hash +#include // std::__detail::_Node_const_iterator +#include // std::__detail::_Node_iterator +#include // std::unordered_map #include // std::pair #include // std::vector @@ -71,25 +89,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M) +void bind_std_stl_map(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::hash file:bits/functional_hash.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_float_t", ""); - cl.def( pybind11::init( [](){ return new std::hash(); } ) ); - cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); - cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); - cl.def("assign", (struct std::hash & (std::hash::*)(const struct std::hash &)) &std::hash::operator=, "C++: std::hash::operator=(const struct std::hash &) --> struct std::hash &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // std::hash file:bits/basic_string.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_std_string_t", ""); - cl.def( pybind11::init( [](){ return new std::hash(); } ) ); - cl.def("__call__", (std::size_t (std::hash::*)(const std::string &) const) &std::hash::operator(), "C++: std::hash::operator()(const std::string &) const --> std::size_t", pybind11::arg("__s")); - } { // std::map file:bits/stl_map.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "map_float_int_t", ""); cl.def( pybind11::init( [](){ return new std::map(); } ) ); @@ -97,42 +103,90 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::map const &o){ return new std::map(o); } ) ); - cl.def("assign", (class std::map, class std::allocator > > & (std::map::*)(const class std::map, class std::allocator > > &)) &std::map, std::allocator > >::operator=, "C++: std::map, std::allocator > >::operator=(const class std::map, class std::allocator > > &) --> class std::map, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator > (std::map::*)() const) &std::map, std::allocator > >::get_allocator, "C++: std::map, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::map::*)() const) &std::map, std::allocator > >::empty, "C++: std::map, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::map::*)() const) &std::map, std::allocator > >::size, "C++: std::map, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::map::*)() const) &std::map, std::allocator > >::max_size, "C++: std::map, std::allocator > >::max_size() const --> unsigned long"); - cl.def("__getitem__", (int & (std::map::*)(const float &)) &std::map, std::allocator > >::operator[], "C++: std::map, std::allocator > >::operator[](const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("at", (int & (std::map::*)(const float &)) &std::map, std::allocator > >::at, "C++: std::map, std::allocator > >::at(const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("insert", (struct std::pair >, bool> (std::map::*)(const struct std::pair &)) &std::map, std::allocator > >::insert, "C++: std::map, std::allocator > >::insert(const struct std::pair &) --> struct std::pair >, bool>", pybind11::arg("__x")); - cl.def("erase", (unsigned long (std::map::*)(const float &)) &std::map, std::allocator > >::erase, "C++: std::map, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::map::*)(class std::map, class std::allocator > > &)) &std::map, std::allocator > >::swap, "C++: std::map, std::allocator > >::swap(class std::map, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::map::*)()) &std::map, std::allocator > >::clear, "C++: std::map, std::allocator > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::map::*)() const) &std::map, std::allocator > >::key_comp, "C++: std::map, std::allocator > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::map::*)(const float &) const) &std::map, std::allocator > >::count, "C++: std::map, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::map::*)(const float &)) &std::map, std::allocator > >::equal_range, "C++: std::map, std::allocator > >::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::map & (std::map::*)(const class std::map &)) &std::map::operator=, "C++: std::map::operator=(const class std::map &) --> class std::map &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::map::*)() const) &std::map::get_allocator, "C++: std::map::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::map::*)() const) &std::map::empty, "C++: std::map::empty() const --> bool"); + cl.def("size", (unsigned long (std::map::*)() const) &std::map::size, "C++: std::map::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::map::*)() const) &std::map::max_size, "C++: std::map::max_size() const --> unsigned long"); + cl.def("__getitem__", (int & (std::map::*)(const float &)) &std::map::operator[], "C++: std::map::operator[](const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); + cl.def("at", (int & (std::map::*)(const float &)) &std::map::at, "C++: std::map::at(const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); + cl.def("insert", (struct std::pair >, bool> (std::map::*)(const struct std::pair &)) &std::map::insert, "C++: std::map::insert(const struct std::pair &) --> struct std::pair >, bool>", pybind11::arg("__x")); + cl.def("erase", (unsigned long (std::map::*)(const float &)) &std::map::erase, "C++: std::map::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::map::*)(class std::map &)) &std::map::swap, "C++: std::map::swap(class std::map &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::map::*)()) &std::map::clear, "C++: std::map::clear() --> void"); + cl.def("key_comp", (struct std::less (std::map::*)() const) &std::map::key_comp, "C++: std::map::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::map::*)(const float &) const) &std::map::count, "C++: std::map::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::map::*)(const float &)) &std::map::equal_range, "C++: std::map::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); } { // std::map file:bits/stl_map.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "map_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::map>>>>(); } ) ); - cl.def( pybind11::init( [](const struct std::less & a0){ return new std::map>>>>(a0); } ), "doc" , pybind11::arg("__comp")); - cl.def( pybind11::init &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::map>>>> const &o){ return new std::map>>>>(o); } ) ); - cl.def("assign", (class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::map>>>>::*)(const class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::map>>>, std::less, std::allocator>>> > > >::operator=, "C++: std::map>>>, std::less, std::allocator>>> > > >::operator=(const class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::map>>>>::*)() const) &std::map>>>, std::less, std::allocator>>> > > >::get_allocator, "C++: std::map>>>, std::less, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::map>>>>::*)() const) &std::map>>>, std::less, std::allocator>>> > > >::empty, "C++: std::map>>>, std::less, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::map>>>>::*)() const) &std::map>>>, std::less, std::allocator>>> > > >::size, "C++: std::map>>>, std::less, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::map>>>>::*)() const) &std::map>>>, std::less, std::allocator>>> > > >::max_size, "C++: std::map>>>, std::less, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("__getitem__", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::map>>>>::*)(const std::string &)) &std::map>>>, std::less, std::allocator>>> > > >::operator[], "C++: std::map>>>, std::less, std::allocator>>> > > >::operator[](const std::string &) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("at", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::map>>>>::*)(const std::string &)) &std::map>>>, std::less, std::allocator>>> > > >::at, "C++: std::map>>>, std::less, std::allocator>>> > > >::at(const std::string &) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("insert", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, bool> (std::map>>>>::*)(const struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &)) &std::map>>>, std::less, std::allocator>>> > > >::insert, "C++: std::map>>>, std::less, std::allocator>>> > > >::insert(const struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, bool>", pybind11::arg("__x")); - cl.def("erase", (unsigned long (std::map>>>>::*)(const std::string &)) &std::map>>>, std::less, std::allocator>>> > > >::erase, "C++: std::map>>>, std::less, std::allocator>>> > > >::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::map>>>>::*)(class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::map>>>, std::less, std::allocator>>> > > >::swap, "C++: std::map>>>, std::less, std::allocator>>> > > >::swap(class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::map>>>>::*)()) &std::map>>>, std::less, std::allocator>>> > > >::clear, "C++: std::map>>>, std::less, std::allocator>>> > > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::map>>>>::*)() const) &std::map>>>, std::less, std::allocator>>> > > >::key_comp, "C++: std::map>>>, std::less, std::allocator>>> > > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::map>>>>::*)(const std::string &) const) &std::map>>>, std::less, std::allocator>>> > > >::count, "C++: std::map>>>, std::less, std::allocator>>> > > >::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > (std::map>>>>::*)(const std::string &)) &std::map>>>, std::less, std::allocator>>> > > >::equal_range, "C++: std::map>>>, std::less, std::allocator>>> > > >::equal_range(const std::string &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >", pybind11::arg("__x")); + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "map_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::map > > >>(); } ) ); + cl.def( pybind11::init( [](const struct std::less & a0){ return new std::map > > >>(a0); } ), "doc" , pybind11::arg("__comp")); + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::map > > >> const &o){ return new std::map > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::map > > > > & (std::map > > >>::*)(const class std::map > > > > &)) &std::map>>>>::operator=, "C++: std::map>>>>::operator=(const class std::map > > > > &) --> class std::map > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::map > > >>::*)() const) &std::map>>>>::get_allocator, "C++: std::map>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::map > > >>::*)() const) &std::map>>>>::empty, "C++: std::map>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::map > > >>::*)() const) &std::map>>>>::size, "C++: std::map>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::map > > >>::*)() const) &std::map>>>>::max_size, "C++: std::map>>>>::max_size() const --> unsigned long"); + cl.def("insert", (struct std::pair > > > > >, bool> (std::map > > >>::*)(const struct std::pair > > > > &)) &std::map>>>>::insert, "C++: std::map>>>>::insert(const struct std::pair > > > > &) --> struct std::pair > > > > >, bool>", pybind11::arg("__x")); + cl.def("erase", (unsigned long (std::map > > >>::*)(const std::string &)) &std::map>>>>::erase, "C++: std::map>>>>::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::map > > >>::*)(class std::map > > > > &)) &std::map>>>>::swap, "C++: std::map>>>>::swap(class std::map > > > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::map > > >>::*)()) &std::map>>>>::clear, "C++: std::map>>>>::clear() --> void"); + cl.def("key_comp", (struct std::less (std::map > > >>::*)() const) &std::map>>>>::key_comp, "C++: std::map>>>>::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::map > > >>::*)(const std::string &) const) &std::map>>>>::count, "C++: std::map>>>>::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > > (std::map > > >>::*)(const std::string &)) &std::map>>>>::equal_range, "C++: std::map>>>>::equal_range(const std::string &) --> struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > >", pybind11::arg("__x")); + } + { // std::unordered_map file:bits/unordered_map.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_map_float_int_t", ""); + cl.def( pybind11::init( [](){ return new std::unordered_map(); } ) ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_map(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_map(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_map(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); + cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::unordered_map const &o){ return new std::unordered_map(o); } ) ); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__umap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_map & (std::unordered_map::*)(const class std::unordered_map &)) &std::unordered_map::operator=, "C++: std::unordered_map::operator=(const class std::unordered_map &) --> class std::unordered_map &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::unordered_map::*)() const) &std::unordered_map::get_allocator, "C++: std::unordered_map::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::unordered_map::*)() const) &std::unordered_map::empty, "C++: std::unordered_map::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_map::*)() const) &std::unordered_map::size, "C++: std::unordered_map::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_map::*)() const) &std::unordered_map::max_size, "C++: std::unordered_map::max_size() const --> unsigned long"); + cl.def("insert", (struct std::pair, false, false>, bool> (std::unordered_map::*)(const struct std::pair &)) &std::unordered_map::insert, "C++: std::unordered_map::insert(const struct std::pair &) --> struct std::pair, false, false>, bool>", pybind11::arg("__x")); + cl.def("erase", (unsigned long (std::unordered_map::*)(const float &)) &std::unordered_map::erase, "C++: std::unordered_map::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_map::*)()) &std::unordered_map::clear, "C++: std::unordered_map::clear() --> void"); + cl.def("swap", (void (std::unordered_map::*)(class std::unordered_map &)) &std::unordered_map::swap, "C++: std::unordered_map::swap(class std::unordered_map &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_map::*)() const) &std::unordered_map::hash_function, "C++: std::unordered_map::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_map::*)() const) &std::unordered_map::key_eq, "C++: std::unordered_map::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_map::*)(const float &) const) &std::unordered_map::count, "C++: std::unordered_map::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_map::*)(const float &)) &std::unordered_map::equal_range, "C++: std::unordered_map::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); + cl.def("__getitem__", (int & (std::unordered_map::*)(const float &)) &std::unordered_map::operator[], "C++: std::unordered_map::operator[](const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); + cl.def("at", (int & (std::unordered_map::*)(const float &)) &std::unordered_map::at, "C++: std::unordered_map::at(const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); + cl.def("bucket_count", (unsigned long (std::unordered_map::*)() const) &std::unordered_map::bucket_count, "C++: std::unordered_map::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_map::*)() const) &std::unordered_map::max_bucket_count, "C++: std::unordered_map::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_map::*)(unsigned long) const) &std::unordered_map::bucket_size, "C++: std::unordered_map::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_map::*)(const float &) const) &std::unordered_map::bucket, "C++: std::unordered_map::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_map::*)() const) &std::unordered_map::load_factor, "C++: std::unordered_map::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_map::*)() const) &std::unordered_map::max_load_factor, "C++: std::unordered_map::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_map::*)(float)) &std::unordered_map::max_load_factor, "C++: std::unordered_map::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_map::*)(unsigned long)) &std::unordered_map::rehash, "C++: std::unordered_map::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_map::*)(unsigned long)) &std::unordered_map::reserve, "C++: std::unordered_map::reserve(unsigned long) --> void", pybind11::arg("__n")); } } @@ -141,7 +195,6 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons #include // std::deque #include // std::forward_list #include // std::equal_to -#include // std::hash #include // __gnu_cxx::__normal_iterator #include // std::list #include // std::allocator @@ -161,129 +214,52 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_std_unordered_map(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // std::unordered_map file:bits/unordered_map.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_map_float_int_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_map(); } ), "doc" ); - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_map(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_map(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_map(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); - cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::unordered_map const &o){ return new std::unordered_map(o); } ) ); - cl.def("assign", (class std::unordered_map, struct std::equal_to, class std::allocator > > & (std::unordered_map::*)(const class std::unordered_map, struct std::equal_to, class std::allocator > > &)) &std::unordered_map, std::equal_to, std::allocator > >::operator=, "C++: std::unordered_map, std::equal_to, std::allocator > >::operator=(const class std::unordered_map, struct std::equal_to, class std::allocator > > &) --> class std::unordered_map, struct std::equal_to, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator > (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::get_allocator, "C++: std::unordered_map, std::equal_to, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::empty, "C++: std::unordered_map, std::equal_to, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::size, "C++: std::unordered_map, std::equal_to, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::max_size, "C++: std::unordered_map, std::equal_to, std::allocator > >::max_size() const --> unsigned long"); - cl.def("insert", (struct std::pair, false, false>, bool> (std::unordered_map::*)(const struct std::pair &)) &std::unordered_map, std::equal_to, std::allocator > >::insert, "C++: std::unordered_map, std::equal_to, std::allocator > >::insert(const struct std::pair &) --> struct std::pair, false, false>, bool>", pybind11::arg("__x")); - cl.def("erase", (unsigned long (std::unordered_map::*)(const float &)) &std::unordered_map, std::equal_to, std::allocator > >::erase, "C++: std::unordered_map, std::equal_to, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_map::*)()) &std::unordered_map, std::equal_to, std::allocator > >::clear, "C++: std::unordered_map, std::equal_to, std::allocator > >::clear() --> void"); - cl.def("swap", (void (std::unordered_map::*)(class std::unordered_map, struct std::equal_to, class std::allocator > > &)) &std::unordered_map, std::equal_to, std::allocator > >::swap, "C++: std::unordered_map, std::equal_to, std::allocator > >::swap(class std::unordered_map, struct std::equal_to, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::hash_function, "C++: std::unordered_map, std::equal_to, std::allocator > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::key_eq, "C++: std::unordered_map, std::equal_to, std::allocator > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_map::*)(const float &) const) &std::unordered_map, std::equal_to, std::allocator > >::count, "C++: std::unordered_map, std::equal_to, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_map::*)(const float &)) &std::unordered_map, std::equal_to, std::allocator > >::equal_range, "C++: std::unordered_map, std::equal_to, std::allocator > >::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); - cl.def("__getitem__", (int & (std::unordered_map::*)(const float &)) &std::unordered_map, std::equal_to, std::allocator > >::operator[], "C++: std::unordered_map, std::equal_to, std::allocator > >::operator[](const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("at", (int & (std::unordered_map::*)(const float &)) &std::unordered_map, std::equal_to, std::allocator > >::at, "C++: std::unordered_map, std::equal_to, std::allocator > >::at(const float &) --> int &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("bucket_count", (unsigned long (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::bucket_count, "C++: std::unordered_map, std::equal_to, std::allocator > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::max_bucket_count, "C++: std::unordered_map, std::equal_to, std::allocator > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_map::*)(unsigned long) const) &std::unordered_map, std::equal_to, std::allocator > >::bucket_size, "C++: std::unordered_map, std::equal_to, std::allocator > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_map::*)(const float &) const) &std::unordered_map, std::equal_to, std::allocator > >::bucket, "C++: std::unordered_map, std::equal_to, std::allocator > >::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::load_factor, "C++: std::unordered_map, std::equal_to, std::allocator > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_map::*)() const) &std::unordered_map, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_map, std::equal_to, std::allocator > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_map::*)(float)) &std::unordered_map, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_map, std::equal_to, std::allocator > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_map::*)(unsigned long)) &std::unordered_map, std::equal_to, std::allocator > >::rehash, "C++: std::unordered_map, std::equal_to, std::allocator > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_map::*)(unsigned long)) &std::unordered_map, std::equal_to, std::allocator > >::reserve, "C++: std::unordered_map, std::equal_to, std::allocator > >::reserve(unsigned long) --> void", pybind11::arg("__n")); - } - { // std::unordered_map file:bits/unordered_map.h line: - pybind11::class_>>>,std::hash,std::equal_to,std::allocator>>> > >>, std::shared_ptr>>>,std::hash,std::equal_to,std::allocator>>> > >>>> cl(M("std"), "unordered_map_std_string_std_list_std_forward_list_std_deque_std_vector_double_std_hash_std_string_std_equal_to_std_string_std_allocator_std_pair_const_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>(); } ), "doc" ); - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); - cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >> const &o){ return new std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>(o); } ) ); - cl.def("assign", (class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=(const class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::size, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("insert", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, bool> (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::insert, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::insert(const struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, bool>", pybind11::arg("__x")); - cl.def("erase", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)()) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear() --> void"); - cl.def("swap", (void (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap(class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &) const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::count, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true> > (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range(const std::string &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true> >", pybind11::arg("__x")); - cl.def("__getitem__", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator[], "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator[](const std::string &) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("at", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::at, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::at(const std::string &) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__k")); - cl.def("bucket_count", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(unsigned long) const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(const std::string &) const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket(const std::string &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)() const) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(float)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(unsigned long)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_map>>>,std::hash,std::equal_to,std::allocator>>> > >>::*)(unsigned long)) &std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve, "C++: std::unordered_map>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve(unsigned long) --> void", pybind11::arg("__n")); - } -} - - -// File: std/stl_list.cpp -#include // std::deque -#include // std::forward_list -#include // std::list -#include // std::allocator -#include // __str__ -#include // std::vector - -#include -#include -#include - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_std_stl_list(std::function< pybind11::module &(std::string const &namespace_) > &M) -{ - { // std::list file:bits/stl_list.h line: - pybind11::class_>>>, std::shared_ptr>>>>> cl(M("std"), "list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::list>>>(); } ) ); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > &>(), pybind11::arg("__a") ); - - cl.def( pybind11::init(), pybind11::arg("__n") ); - - cl.def( pybind11::init( [](std::list>>> const &o){ return new std::list>>>(o); } ) ); - cl.def("assign", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::list>>>::*)(const class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &)) &std::list>>>::operator=, "C++: std::list>>>::operator=(const class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::list>>>::*)() const) &std::list>>>::get_allocator, "C++: std::list>>>::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >"); - cl.def("empty", (bool (std::list>>>::*)() const) &std::list>>>::empty, "C++: std::list>>>::empty() const --> bool"); - cl.def("size", (unsigned long (std::list>>>::*)() const) &std::list>>>::size, "C++: std::list>>>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::list>>>::*)() const) &std::list>>>::max_size, "C++: std::list>>>::max_size() const --> unsigned long"); - cl.def("resize", (void (std::list>>>::*)(unsigned long)) &std::list>>>::resize, "C++: std::list>>>::resize(unsigned long) --> void", pybind11::arg("__new_size")); - cl.def("front", (class std::forward_list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::list>>>::*)()) &std::list>>>::front, "C++: std::list>>>::front() --> class std::forward_list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic); - cl.def("back", (class std::forward_list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::list>>>::*)()) &std::list>>>::back, "C++: std::list>>>::back() --> class std::forward_list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic); - cl.def("pop_front", (void (std::list>>>::*)()) &std::list>>>::pop_front, "C++: std::list>>>::pop_front() --> void"); - cl.def("pop_back", (void (std::list>>>::*)()) &std::list>>>::pop_back, "C++: std::list>>>::pop_back() --> void"); - cl.def("swap", (void (std::list>>>::*)(class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &)) &std::list>>>::swap, "C++: std::list>>>::swap(class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::list>>>::*)()) &std::list>>>::clear, "C++: std::list>>>::clear() --> void"); - cl.def("unique", (void (std::list>>>::*)()) &std::list>>>::unique, "C++: std::list>>>::unique() --> void"); - cl.def("merge", (void (std::list>>>::*)(class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &)) &std::list>>>::merge, "C++: std::list>>>::merge(class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("reverse", (void (std::list>>>::*)()) &std::list>>>::reverse, "C++: std::list>>>::reverse() --> void"); - cl.def("sort", (void (std::list>>>::*)()) &std::list>>>::sort, "C++: std::list>>>::sort() --> void"); + pybind11::class_ > > >,std::hash,std::equal_to,std::allocator > > > > >>, std::shared_ptr > > >,std::hash,std::equal_to,std::allocator > > > > >>>> cl(M("std"), "unordered_map_std_string_std_list_std_forward_list_std_deque_std_vector_double_std_hash_std_string_std_equal_to_std_string_std_allocator_std_pair_const_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>(); } ) ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); + cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >> const &o){ return new std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__umap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_map > > > > & (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const class std::unordered_map > > > > &)) &std::unordered_map>>>>::operator=, "C++: std::unordered_map>>>>::operator=(const class std::unordered_map > > > > &) --> class std::unordered_map > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::get_allocator, "C++: std::unordered_map>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::empty, "C++: std::unordered_map>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::size, "C++: std::unordered_map>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::max_size, "C++: std::unordered_map>>>>::max_size() const --> unsigned long"); + cl.def("insert", (struct std::pair > > > >, false, true>, bool> (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const struct std::pair > > > > &)) &std::unordered_map>>>>::insert, "C++: std::unordered_map>>>>::insert(const struct std::pair > > > > &) --> struct std::pair > > > >, false, true>, bool>", pybind11::arg("__x")); + cl.def("erase", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const std::string &)) &std::unordered_map>>>>::erase, "C++: std::unordered_map>>>>::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)()) &std::unordered_map>>>>::clear, "C++: std::unordered_map>>>>::clear() --> void"); + cl.def("swap", (void (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(class std::unordered_map > > > > &)) &std::unordered_map>>>>::swap, "C++: std::unordered_map>>>>::swap(class std::unordered_map > > > > &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::hash_function, "C++: std::unordered_map>>>>::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::key_eq, "C++: std::unordered_map>>>>::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const std::string &) const) &std::unordered_map>>>>::count, "C++: std::unordered_map>>>>::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > >, false, true>, struct std::__detail::_Node_iterator > > > >, false, true> > (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const std::string &)) &std::unordered_map>>>>::equal_range, "C++: std::unordered_map>>>>::equal_range(const std::string &) --> struct std::pair > > > >, false, true>, struct std::__detail::_Node_iterator > > > >, false, true> >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::bucket_count, "C++: std::unordered_map>>>>::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::max_bucket_count, "C++: std::unordered_map>>>>::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(unsigned long) const) &std::unordered_map>>>>::bucket_size, "C++: std::unordered_map>>>>::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(const std::string &) const) &std::unordered_map>>>>::bucket, "C++: std::unordered_map>>>>::bucket(const std::string &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::load_factor, "C++: std::unordered_map>>>>::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)() const) &std::unordered_map>>>>::max_load_factor, "C++: std::unordered_map>>>>::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(float)) &std::unordered_map>>>>::max_load_factor, "C++: std::unordered_map>>>>::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(unsigned long)) &std::unordered_map>>>>::rehash, "C++: std::unordered_map>>>>::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_map > > >,std::hash,std::equal_to,std::allocator > > > > >>::*)(unsigned long)) &std::unordered_map>>>>::reserve, "C++: std::unordered_map>>>>::reserve(unsigned long) --> void", pybind11::arg("__n")); } } @@ -316,24 +292,24 @@ void bind_std_stl_list(std::function< pybind11::module &(std::string const &name #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names_map(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::map, class std::allocator > >) file:T42.stl.names.map.hpp line: - M("").def("foo", (void (*)(class std::map, class std::allocator > >)) &foo, "C++: foo(class std::map, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::map) file:T42.stl.names.map.hpp line: + M("").def("foo", (void (*)(class std::map)) &foo, "C++: foo(class std::map) --> void", pybind11::arg("")); - // foo(class std::unordered_map, struct std::equal_to, class std::allocator > >) file:T42.stl.names.map.hpp line: - M("").def("foo", (void (*)(class std::unordered_map, struct std::equal_to, class std::allocator > >)) &foo, "C++: foo(class std::unordered_map, struct std::equal_to, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::unordered_map) file:T42.stl.names.map.hpp line: + M("").def("foo", (void (*)(class std::unordered_map)) &foo, "C++: foo(class std::unordered_map) --> void", pybind11::arg("")); - // foo(class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.map.hpp line: - M("").def("foo", (void (*)(class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::map > > > >) file:T42.stl.names.map.hpp line: + M("").def("foo", (void (*)(class std::map > > > >)) &foo, "C++: foo(class std::map > > > >) --> void", pybind11::arg("")); - // foo(class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.map.hpp line: - M("").def("foo", (void (*)(class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::unordered_map >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::unordered_map > > > >) file:T42.stl.names.map.hpp line: + M("").def("foo", (void (*)(class std::unordered_map > > > >)) &foo, "C++: foo(class std::unordered_map > > > >) --> void", pybind11::arg("")); } @@ -347,12 +323,11 @@ void bind_T42_stl_names_map(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_std_stl_map(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_std_unordered_map(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_stl_list(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T42_stl_names_map(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -373,21 +348,20 @@ PYBIND11_MODULE(T42_stl_names_map, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); bind_std_stl_function(M); - bind_std_functional_hash(M); + bind_std_stl_map(M); bind_std_unordered_map(M); - bind_std_stl_list(M); bind_T42_stl_names_map(M); } @@ -395,9 +369,8 @@ PYBIND11_MODULE(T42_stl_names_map, root_module) { // Source list file: TEST/T42_stl_names_map.sources // T42_stl_names_map.cpp // std/stl_function.cpp -// std/functional_hash.cpp +// std/stl_map.cpp // std/unordered_map.cpp -// std/stl_list.cpp // T42_stl_names_map.cpp // Modules list file: TEST/T42_stl_names_map.modules diff --git a/test/T42.stl.names.multi.ref.cpp b/test/T42.stl.names.multi.ref.cpp index 27b2f586..26c1558f 100644 --- a/test/T42.stl.names.multi.ref.cpp +++ b/test/T42.stl.names.multi.ref.cpp @@ -13,8 +13,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -35,21 +35,24 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_float_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); cl.def("__call__", (bool (std::equal_to::*)(const float &, const float &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const float &, const float &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_std_string_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); - cl.def("__call__", (bool (std::equal_to::*)(const std::string &, const std::string &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const std::string &, const std::string &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); + cl.def("__call__", (bool (std::equal_to::*)(const std::string &, const std::string &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const std::string &, const std::string &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } } -// File: std/functional_hash.cpp +// File: std/basic_string.cpp #include // std::deque #include // std::forward_list +#include // std::equal_to #include // std::hash #include // std::less #include // __gnu_cxx::__normal_iterator @@ -58,10 +61,14 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #include // std::_Rb_tree_iterator #include // std::multimap #include // std::allocator +#include // std::multiset #include // __str__ #include // std::basic_string #include // std::char_traits #include // std::hash +#include // std::__detail::_Node_const_iterator +#include // std::__detail::_Node_iterator +#include // std::unordered_multimap #include // std::pair #include // std::vector @@ -71,24 +78,23 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M) +void bind_std_basic_string(std::function< pybind11::module &(std::string const &namespace_) > &M) { + { // std::hash file:bits/basic_string.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_std_string_t", ""); + cl.def( pybind11::init( [](){ return new std::hash(); } ) ); + cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); + } { // std::hash file:bits/functional_hash.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_float_t", ""); cl.def( pybind11::init( [](){ return new std::hash(); } ) ); cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); - cl.def("assign", (struct std::hash & (std::hash::*)(const struct std::hash &)) &std::hash::operator=, "C++: std::hash::operator=(const struct std::hash &) --> struct std::hash &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } - { // std::hash file:bits/basic_string.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_std_string_t", ""); - cl.def( pybind11::init( [](){ return new std::hash(); } ) ); - cl.def("__call__", (std::size_t (std::hash::*)(const std::string &) const) &std::hash::operator(), "C++: std::hash::operator()(const std::string &) const --> std::size_t", pybind11::arg("__s")); } { // std::multimap file:bits/stl_multimap.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "multimap_float_int_t", ""); @@ -97,74 +103,45 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::multimap const &o){ return new std::multimap(o); } ) ); - cl.def("assign", (class std::multimap, class std::allocator > > & (std::multimap::*)(const class std::multimap, class std::allocator > > &)) &std::multimap, std::allocator > >::operator=, "C++: std::multimap, std::allocator > >::operator=(const class std::multimap, class std::allocator > > &) --> class std::multimap, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator > (std::multimap::*)() const) &std::multimap, std::allocator > >::get_allocator, "C++: std::multimap, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::multimap::*)() const) &std::multimap, std::allocator > >::empty, "C++: std::multimap, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::multimap::*)() const) &std::multimap, std::allocator > >::size, "C++: std::multimap, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::multimap::*)() const) &std::multimap, std::allocator > >::max_size, "C++: std::multimap, std::allocator > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::multimap::*)(const float &)) &std::multimap, std::allocator > >::erase, "C++: std::multimap, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::multimap::*)(class std::multimap, class std::allocator > > &)) &std::multimap, std::allocator > >::swap, "C++: std::multimap, std::allocator > >::swap(class std::multimap, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::multimap::*)()) &std::multimap, std::allocator > >::clear, "C++: std::multimap, std::allocator > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::multimap::*)() const) &std::multimap, std::allocator > >::key_comp, "C++: std::multimap, std::allocator > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::multimap::*)(const float &) const) &std::multimap, std::allocator > >::count, "C++: std::multimap, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::multimap::*)(const float &)) &std::multimap, std::allocator > >::equal_range, "C++: std::multimap, std::allocator > >::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multimap & (std::multimap::*)(const class std::multimap &)) &std::multimap::operator=, "C++: std::multimap::operator=(const class std::multimap &) --> class std::multimap &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::multimap::*)() const) &std::multimap::get_allocator, "C++: std::multimap::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::multimap::*)() const) &std::multimap::empty, "C++: std::multimap::empty() const --> bool"); + cl.def("size", (unsigned long (std::multimap::*)() const) &std::multimap::size, "C++: std::multimap::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::multimap::*)() const) &std::multimap::max_size, "C++: std::multimap::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::multimap::*)(const float &)) &std::multimap::erase, "C++: std::multimap::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::multimap::*)(class std::multimap &)) &std::multimap::swap, "C++: std::multimap::swap(class std::multimap &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::multimap::*)()) &std::multimap::clear, "C++: std::multimap::clear() --> void"); + cl.def("key_comp", (struct std::less (std::multimap::*)() const) &std::multimap::key_comp, "C++: std::multimap::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::multimap::*)(const float &) const) &std::multimap::count, "C++: std::multimap::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::multimap::*)(const float &)) &std::multimap::equal_range, "C++: std::multimap::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); } { // std::multimap file:bits/stl_multimap.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "multimap_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::multimap>>>>(); } ) ); - cl.def( pybind11::init( [](const struct std::less & a0){ return new std::multimap>>>>(a0); } ), "doc" , pybind11::arg("__comp")); - cl.def( pybind11::init &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::multimap>>>> const &o){ return new std::multimap>>>>(o); } ) ); - cl.def("assign", (class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::multimap>>>>::*)(const class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::multimap>>>, std::less, std::allocator>>> > > >::operator=, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::operator=(const class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::get_allocator, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::empty, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::size, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::max_size, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::multimap>>>>::*)(const std::string &)) &std::multimap>>>, std::less, std::allocator>>> > > >::erase, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::multimap>>>>::*)(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::multimap>>>, std::less, std::allocator>>> > > >::swap, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::swap(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::multimap>>>>::*)()) &std::multimap>>>, std::less, std::allocator>>> > > >::clear, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::key_comp, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::multimap>>>>::*)(const std::string &) const) &std::multimap>>>, std::less, std::allocator>>> > > >::count, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > (std::multimap>>>>::*)(const std::string &)) &std::multimap>>>, std::less, std::allocator>>> > > >::equal_range, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::equal_range(const std::string &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >", pybind11::arg("__x")); + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "multimap_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::multimap > > >>(); } ) ); + cl.def( pybind11::init( [](const struct std::less & a0){ return new std::multimap > > >>(a0); } ), "doc" , pybind11::arg("__comp")); + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::multimap > > >> const &o){ return new std::multimap > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multimap > > > > & (std::multimap > > >>::*)(const class std::multimap > > > > &)) &std::multimap>>>>::operator=, "C++: std::multimap>>>>::operator=(const class std::multimap > > > > &) --> class std::multimap > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::multimap > > >>::*)() const) &std::multimap>>>>::get_allocator, "C++: std::multimap>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::multimap > > >>::*)() const) &std::multimap>>>>::empty, "C++: std::multimap>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::multimap > > >>::*)() const) &std::multimap>>>>::size, "C++: std::multimap>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::multimap > > >>::*)() const) &std::multimap>>>>::max_size, "C++: std::multimap>>>>::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::multimap > > >>::*)(const std::string &)) &std::multimap>>>>::erase, "C++: std::multimap>>>>::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::multimap > > >>::*)(class std::multimap > > > > &)) &std::multimap>>>>::swap, "C++: std::multimap>>>>::swap(class std::multimap > > > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::multimap > > >>::*)()) &std::multimap>>>>::clear, "C++: std::multimap>>>>::clear() --> void"); + cl.def("key_comp", (struct std::less (std::multimap > > >>::*)() const) &std::multimap>>>>::key_comp, "C++: std::multimap>>>>::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::multimap > > >>::*)(const std::string &) const) &std::multimap>>>>::count, "C++: std::multimap>>>>::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > > (std::multimap > > >>::*)(const std::string &)) &std::multimap>>>>::equal_range, "C++: std::multimap>>>>::equal_range(const std::string &) --> struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > >", pybind11::arg("__x")); } -} - - -// File: std/stl_multiset.cpp -#include // std::deque -#include // std::forward_list -#include // std::equal_to -#include // std::hash -#include // std::less -#include // __gnu_cxx::__normal_iterator -#include // std::list -#include // std::_Rb_tree_const_iterator -#include // std::allocator -#include // std::multiset -#include // __str__ -#include // std::basic_string -#include // std::char_traits -#include // std::hash -#include // std::__detail::_Node_const_iterator -#include // std::__detail::_Node_iterator -#include // std::unordered_multimap -#include // std::pair -#include // std::vector - -#include -#include -#include - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_std_stl_multiset(std::function< pybind11::module &(std::string const &namespace_) > &M) -{ { // std::multiset file:bits/stl_multiset.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "multiset_float_t", ""); cl.def( pybind11::init( [](){ return new std::multiset(); } ) ); @@ -172,14 +149,18 @@ void bind_std_stl_multiset(std::function< pybind11::module &(std::string const & cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::multiset const &o){ return new std::multiset(o); } ) ); - cl.def("assign", (class std::multiset, class std::allocator > & (std::multiset::*)(const class std::multiset, class std::allocator > &)) &std::multiset::operator=, "C++: std::multiset::operator=(const class std::multiset, class std::allocator > &) --> class std::multiset, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multiset & (std::multiset::*)(const class std::multiset &)) &std::multiset::operator=, "C++: std::multiset::operator=(const class std::multiset &) --> class std::multiset &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def("key_comp", (struct std::less (std::multiset::*)() const) &std::multiset::key_comp, "C++: std::multiset::key_comp() const --> struct std::less"); cl.def("value_comp", (struct std::less (std::multiset::*)() const) &std::multiset::value_comp, "C++: std::multiset::value_comp() const --> struct std::less"); cl.def("get_allocator", (class std::allocator (std::multiset::*)() const) &std::multiset::get_allocator, "C++: std::multiset::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::multiset::*)() const) &std::multiset::empty, "C++: std::multiset::empty() const --> bool"); cl.def("size", (unsigned long (std::multiset::*)() const) &std::multiset::size, "C++: std::multiset::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::multiset::*)() const) &std::multiset::max_size, "C++: std::multiset::max_size() const --> unsigned long"); - cl.def("swap", (void (std::multiset::*)(class std::multiset, class std::allocator > &)) &std::multiset::swap, "C++: std::multiset::swap(class std::multiset, class std::allocator > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::multiset::*)(class std::multiset &)) &std::multiset::swap, "C++: std::multiset::swap(class std::multiset &) --> void", pybind11::arg("__x")); cl.def("erase", (unsigned long (std::multiset::*)(const float &)) &std::multiset::erase, "C++: std::multiset::erase(const float &) --> unsigned long", pybind11::arg("__x")); cl.def("clear", (void (std::multiset::*)()) &std::multiset::clear, "C++: std::multiset::clear() --> void"); cl.def("count", (unsigned long (std::multiset::*)(const float &) const) &std::multiset::count, "C++: std::multiset::count(const float &) const --> unsigned long", pybind11::arg("__x")); @@ -187,78 +168,64 @@ void bind_std_stl_multiset(std::function< pybind11::module &(std::string const & } { // std::unordered_multimap file:bits/unordered_map.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_multimap_float_int_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multimap(); } ), "doc" ); + cl.def( pybind11::init( [](){ return new std::unordered_multimap(); } ) ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap(a0); } ), "doc" , pybind11::arg("__n")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::unordered_multimap const &o){ return new std::unordered_multimap(o); } ) ); - cl.def("assign", (class std::unordered_multimap, struct std::equal_to, class std::allocator > > & (std::unordered_multimap::*)(const class std::unordered_multimap, struct std::equal_to, class std::allocator > > &)) &std::unordered_multimap, std::equal_to, std::allocator > >::operator=, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::operator=(const class std::unordered_multimap, struct std::equal_to, class std::allocator > > &) --> class std::unordered_multimap, struct std::equal_to, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator > (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::get_allocator, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::empty, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::unordered_multimap::*)(const float &)) &std::unordered_multimap, std::equal_to, std::allocator > >::erase, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_multimap::*)()) &std::unordered_multimap, std::equal_to, std::allocator > >::clear, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::clear() --> void"); - cl.def("swap", (void (std::unordered_multimap::*)(class std::unordered_multimap, struct std::equal_to, class std::allocator > > &)) &std::unordered_multimap, std::equal_to, std::allocator > >::swap, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::swap(class std::unordered_multimap, struct std::equal_to, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::hash_function, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::key_eq, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap, std::equal_to, std::allocator > >::count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_multimap::*)(const float &)) &std::unordered_multimap, std::equal_to, std::allocator > >::equal_range, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); - cl.def("bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket_count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_bucket_count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_multimap::*)(unsigned long) const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket_size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_multimap::*)(float)) &std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap, std::equal_to, std::allocator > >::rehash, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap, std::equal_to, std::allocator > >::reserve, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::reserve(unsigned long) --> void", pybind11::arg("__n")); - } - { // std::unordered_multimap file:bits/unordered_map.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "unordered_multimap_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multimap>>>>(); } ), "doc" ); - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap>>>>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap>>>>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap>>>>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); - cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::unordered_multimap>>>> const &o){ return new std::unordered_multimap>>>>(o); } ) ); - cl.def("assign", (class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::unordered_multimap>>>>::*)(const class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=(const class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::unordered_multimap>>>>::*)(const std::string &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_multimap>>>>::*)()) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear() --> void"); - cl.def("swap", (void (std::unordered_multimap>>>>::*)(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_multimap>>>>::*)(const std::string &) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true> > (std::unordered_multimap>>>>::*)(const std::string &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range(const std::string &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, true> >", pybind11::arg("__x")); - cl.def("bucket_count", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_multimap>>>>::*)(unsigned long) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_multimap>>>>::*)(const std::string &) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket(const std::string &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_multimap>>>>::*)(float)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_multimap>>>>::*)(unsigned long)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_multimap>>>>::*)(unsigned long)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve(unsigned long) --> void", pybind11::arg("__n")); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__ummap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multimap & (std::unordered_multimap::*)(const class std::unordered_multimap &)) &std::unordered_multimap::operator=, "C++: std::unordered_multimap::operator=(const class std::unordered_multimap &) --> class std::unordered_multimap &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::unordered_multimap::*)() const) &std::unordered_multimap::get_allocator, "C++: std::unordered_multimap::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::unordered_multimap::*)() const) &std::unordered_multimap::empty, "C++: std::unordered_multimap::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::size, "C++: std::unordered_multimap::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::max_size, "C++: std::unordered_multimap::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::unordered_multimap::*)(const float &)) &std::unordered_multimap::erase, "C++: std::unordered_multimap::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_multimap::*)()) &std::unordered_multimap::clear, "C++: std::unordered_multimap::clear() --> void"); + cl.def("swap", (void (std::unordered_multimap::*)(class std::unordered_multimap &)) &std::unordered_multimap::swap, "C++: std::unordered_multimap::swap(class std::unordered_multimap &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_multimap::*)() const) &std::unordered_multimap::hash_function, "C++: std::unordered_multimap::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_multimap::*)() const) &std::unordered_multimap::key_eq, "C++: std::unordered_multimap::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap::count, "C++: std::unordered_multimap::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_multimap::*)(const float &)) &std::unordered_multimap::equal_range, "C++: std::unordered_multimap::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::bucket_count, "C++: std::unordered_multimap::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::max_bucket_count, "C++: std::unordered_multimap::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_multimap::*)(unsigned long) const) &std::unordered_multimap::bucket_size, "C++: std::unordered_multimap::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap::bucket, "C++: std::unordered_multimap::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap::load_factor, "C++: std::unordered_multimap::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap::max_load_factor, "C++: std::unordered_multimap::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_multimap::*)(float)) &std::unordered_multimap::max_load_factor, "C++: std::unordered_multimap::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap::rehash, "C++: std::unordered_multimap::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap::reserve, "C++: std::unordered_multimap::reserve(unsigned long) --> void", pybind11::arg("__n")); } } -// File: std/unordered_set.cpp +// File: std/unordered_map.cpp +#include // std::deque +#include // std::forward_list #include // std::equal_to #include // std::hash +#include // __gnu_cxx::__normal_iterator +#include // std::list #include // std::allocator #include // __str__ +#include // std::basic_string +#include // std::char_traits +#include // std::hash #include // std::__detail::_Node_const_iterator #include // std::__detail::_Node_iterator +#include // std::unordered_multimap #include // std::unordered_multiset #include // std::pair +#include // std::vector #include #include @@ -266,30 +233,77 @@ void bind_std_stl_multiset(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -void bind_std_unordered_set(std::function< pybind11::module &(std::string const &namespace_) > &M) +void bind_std_unordered_map(std::function< pybind11::module &(std::string const &namespace_) > &M) { + { // std::unordered_multimap file:bits/unordered_map.h line: + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "unordered_multimap_std_string_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::unordered_multimap > > >>(); } ) ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap > > >>(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap > > >>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap > > >>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); + cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::unordered_multimap > > >> const &o){ return new std::unordered_multimap > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__ummap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multimap > > > > & (std::unordered_multimap > > >>::*)(const class std::unordered_multimap > > > > &)) &std::unordered_multimap>>>>::operator=, "C++: std::unordered_multimap>>>>::operator=(const class std::unordered_multimap > > > > &) --> class std::unordered_multimap > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::get_allocator, "C++: std::unordered_multimap>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::empty, "C++: std::unordered_multimap>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::size, "C++: std::unordered_multimap>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_size, "C++: std::unordered_multimap>>>>::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::unordered_multimap > > >>::*)(const std::string &)) &std::unordered_multimap>>>>::erase, "C++: std::unordered_multimap>>>>::erase(const std::string &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_multimap > > >>::*)()) &std::unordered_multimap>>>>::clear, "C++: std::unordered_multimap>>>>::clear() --> void"); + cl.def("swap", (void (std::unordered_multimap > > >>::*)(class std::unordered_multimap > > > > &)) &std::unordered_multimap>>>>::swap, "C++: std::unordered_multimap>>>>::swap(class std::unordered_multimap > > > > &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::hash_function, "C++: std::unordered_multimap>>>>::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::key_eq, "C++: std::unordered_multimap>>>>::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_multimap > > >>::*)(const std::string &) const) &std::unordered_multimap>>>>::count, "C++: std::unordered_multimap>>>>::count(const std::string &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > >, false, true>, struct std::__detail::_Node_iterator > > > >, false, true> > (std::unordered_multimap > > >>::*)(const std::string &)) &std::unordered_multimap>>>>::equal_range, "C++: std::unordered_multimap>>>>::equal_range(const std::string &) --> struct std::pair > > > >, false, true>, struct std::__detail::_Node_iterator > > > >, false, true> >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::bucket_count, "C++: std::unordered_multimap>>>>::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_bucket_count, "C++: std::unordered_multimap>>>>::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_multimap > > >>::*)(unsigned long) const) &std::unordered_multimap>>>>::bucket_size, "C++: std::unordered_multimap>>>>::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_multimap > > >>::*)(const std::string &) const) &std::unordered_multimap>>>>::bucket, "C++: std::unordered_multimap>>>>::bucket(const std::string &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::load_factor, "C++: std::unordered_multimap>>>>::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_load_factor, "C++: std::unordered_multimap>>>>::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_multimap > > >>::*)(float)) &std::unordered_multimap>>>>::max_load_factor, "C++: std::unordered_multimap>>>>::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_multimap > > >>::*)(unsigned long)) &std::unordered_multimap>>>>::rehash, "C++: std::unordered_multimap>>>>::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_multimap > > >>::*)(unsigned long)) &std::unordered_multimap>>>>::reserve, "C++: std::unordered_multimap>>>>::reserve(unsigned long) --> void", pybind11::arg("__n")); + } { // std::unordered_multiset file:bits/unordered_set.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_multiset_float_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multiset(); } ), "doc" ); + cl.def( pybind11::init( [](){ return new std::unordered_multiset(); } ) ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multiset(a0); } ), "doc" , pybind11::arg("__n")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multiset(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multiset(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::unordered_multiset const &o){ return new std::unordered_multiset(o); } ) ); - cl.def("assign", (class std::unordered_multiset, struct std::equal_to, class std::allocator > & (std::unordered_multiset::*)(const class std::unordered_multiset, struct std::equal_to, class std::allocator > &)) &std::unordered_multiset::operator=, "C++: std::unordered_multiset::operator=(const class std::unordered_multiset, struct std::equal_to, class std::allocator > &) --> class std::unordered_multiset, struct std::equal_to, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__umset"), pybind11::arg("__a") ); + + cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multiset & (std::unordered_multiset::*)(const class std::unordered_multiset &)) &std::unordered_multiset::operator=, "C++: std::unordered_multiset::operator=(const class std::unordered_multiset &) --> class std::unordered_multiset &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def("get_allocator", (class std::allocator (std::unordered_multiset::*)() const) &std::unordered_multiset::get_allocator, "C++: std::unordered_multiset::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::unordered_multiset::*)() const) &std::unordered_multiset::empty, "C++: std::unordered_multiset::empty() const --> bool"); cl.def("size", (unsigned long (std::unordered_multiset::*)() const) &std::unordered_multiset::size, "C++: std::unordered_multiset::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::unordered_multiset::*)() const) &std::unordered_multiset::max_size, "C++: std::unordered_multiset::max_size() const --> unsigned long"); cl.def("erase", (unsigned long (std::unordered_multiset::*)(const float &)) &std::unordered_multiset::erase, "C++: std::unordered_multiset::erase(const float &) --> unsigned long", pybind11::arg("__x")); cl.def("clear", (void (std::unordered_multiset::*)()) &std::unordered_multiset::clear, "C++: std::unordered_multiset::clear() --> void"); - cl.def("swap", (void (std::unordered_multiset::*)(class std::unordered_multiset, struct std::equal_to, class std::allocator > &)) &std::unordered_multiset::swap, "C++: std::unordered_multiset::swap(class std::unordered_multiset, struct std::equal_to, class std::allocator > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::unordered_multiset::*)(class std::unordered_multiset &)) &std::unordered_multiset::swap, "C++: std::unordered_multiset::swap(class std::unordered_multiset &) --> void", pybind11::arg("__x")); cl.def("hash_function", (struct std::hash (std::unordered_multiset::*)() const) &std::unordered_multiset::hash_function, "C++: std::unordered_multiset::hash_function() const --> struct std::hash"); cl.def("key_eq", (struct std::equal_to (std::unordered_multiset::*)() const) &std::unordered_multiset::key_eq, "C++: std::unordered_multiset::key_eq() const --> struct std::equal_to"); cl.def("count", (unsigned long (std::unordered_multiset::*)(const float &) const) &std::unordered_multiset::count, "C++: std::unordered_multiset::count(const float &) const --> unsigned long", pybind11::arg("__x")); @@ -337,30 +351,30 @@ void bind_std_unordered_set(std::function< pybind11::module &(std::string const #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names_multi(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::multimap, class std::allocator > >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::multimap, class std::allocator > >)) &foo, "C++: foo(class std::multimap, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::multimap) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::multimap)) &foo, "C++: foo(class std::multimap) --> void", pybind11::arg("")); - // foo(class std::multiset, class std::allocator >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::multiset, class std::allocator >)) &foo, "C++: foo(class std::multiset, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::multiset) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::multiset)) &foo, "C++: foo(class std::multiset) --> void", pybind11::arg("")); - // foo(class std::unordered_multiset, struct std::equal_to, class std::allocator >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::unordered_multiset, struct std::equal_to, class std::allocator >)) &foo, "C++: foo(class std::unordered_multiset, struct std::equal_to, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::unordered_multiset) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::unordered_multiset)) &foo, "C++: foo(class std::unordered_multiset) --> void", pybind11::arg("")); - // foo(class std::unordered_multimap, struct std::equal_to, class std::allocator > >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::unordered_multimap, struct std::equal_to, class std::allocator > >)) &foo, "C++: foo(class std::unordered_multimap, struct std::equal_to, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::unordered_multimap) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::unordered_multimap)) &foo, "C++: foo(class std::unordered_multimap) --> void", pybind11::arg("")); - // foo(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::multimap > > > >) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::multimap > > > >)) &foo, "C++: foo(class std::multimap > > > >) --> void", pybind11::arg("")); - // foo(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.multi.hpp line: - M("").def("foo", (void (*)(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::unordered_multimap > > > >) file:T42.stl.names.multi.hpp line: + M("").def("foo", (void (*)(class std::unordered_multimap > > > >)) &foo, "C++: foo(class std::unordered_multimap > > > >) --> void", pybind11::arg("")); } @@ -374,12 +388,11 @@ void bind_T42_stl_names_multi(std::function< pybind11::module &(std::string cons #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_stl_multiset(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_unordered_set(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_std_basic_string(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_std_unordered_map(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T42_stl_names_multi(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -400,21 +413,20 @@ PYBIND11_MODULE(T42_stl_names_multi, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); bind_std_stl_function(M); - bind_std_functional_hash(M); - bind_std_stl_multiset(M); - bind_std_unordered_set(M); + bind_std_basic_string(M); + bind_std_unordered_map(M); bind_T42_stl_names_multi(M); } @@ -422,9 +434,8 @@ PYBIND11_MODULE(T42_stl_names_multi, root_module) { // Source list file: TEST/T42_stl_names_multi.sources // T42_stl_names_multi.cpp // std/stl_function.cpp -// std/functional_hash.cpp -// std/stl_multiset.cpp -// std/unordered_set.cpp +// std/basic_string.cpp +// std/unordered_map.cpp // T42_stl_names_multi.cpp // Modules list file: TEST/T42_stl_names_multi.modules diff --git a/test/T42.stl.names.multimap.ref.cpp b/test/T42.stl.names.multimap.ref.cpp index f870e2f5..f462844e 100644 --- a/test/T42.stl.names.multimap.ref.cpp +++ b/test/T42.stl.names.multimap.ref.cpp @@ -9,8 +9,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -25,6 +25,7 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_float_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); cl.def("__call__", (bool (std::equal_to::*)(const float &, const float &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const float &, const float &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } @@ -34,6 +35,7 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & // File: std/functional_hash.cpp #include // std::deque #include // std::forward_list +#include // std::equal_to #include // std::hash #include // std::less #include // std::list @@ -42,6 +44,9 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #include // std::multimap #include // std::allocator #include // __str__ +#include // std::__detail::_Node_const_iterator +#include // std::__detail::_Node_iterator +#include // std::unordered_multimap #include // std::pair #include // std::vector @@ -51,8 +56,8 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -63,7 +68,6 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init( [](){ return new std::hash(); } ) ); cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); - cl.def("assign", (struct std::hash & (std::hash::*)(const struct std::hash &)) &std::hash::operator=, "C++: std::hash::operator=(const struct std::hash &) --> struct std::hash &", pybind11::return_value_policy::automatic, pybind11::arg("")); } { // std::multimap file:bits/stl_multimap.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "multimap_float_int_t", ""); @@ -72,36 +76,83 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::multimap const &o){ return new std::multimap(o); } ) ); - cl.def("assign", (class std::multimap, class std::allocator > > & (std::multimap::*)(const class std::multimap, class std::allocator > > &)) &std::multimap, std::allocator > >::operator=, "C++: std::multimap, std::allocator > >::operator=(const class std::multimap, class std::allocator > > &) --> class std::multimap, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator > (std::multimap::*)() const) &std::multimap, std::allocator > >::get_allocator, "C++: std::multimap, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::multimap::*)() const) &std::multimap, std::allocator > >::empty, "C++: std::multimap, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::multimap::*)() const) &std::multimap, std::allocator > >::size, "C++: std::multimap, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::multimap::*)() const) &std::multimap, std::allocator > >::max_size, "C++: std::multimap, std::allocator > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::multimap::*)(const float &)) &std::multimap, std::allocator > >::erase, "C++: std::multimap, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::multimap::*)(class std::multimap, class std::allocator > > &)) &std::multimap, std::allocator > >::swap, "C++: std::multimap, std::allocator > >::swap(class std::multimap, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::multimap::*)()) &std::multimap, std::allocator > >::clear, "C++: std::multimap, std::allocator > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::multimap::*)() const) &std::multimap, std::allocator > >::key_comp, "C++: std::multimap, std::allocator > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::multimap::*)(const float &) const) &std::multimap, std::allocator > >::count, "C++: std::multimap, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::multimap::*)(const float &)) &std::multimap, std::allocator > >::equal_range, "C++: std::multimap, std::allocator > >::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multimap & (std::multimap::*)(const class std::multimap &)) &std::multimap::operator=, "C++: std::multimap::operator=(const class std::multimap &) --> class std::multimap &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::multimap::*)() const) &std::multimap::get_allocator, "C++: std::multimap::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::multimap::*)() const) &std::multimap::empty, "C++: std::multimap::empty() const --> bool"); + cl.def("size", (unsigned long (std::multimap::*)() const) &std::multimap::size, "C++: std::multimap::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::multimap::*)() const) &std::multimap::max_size, "C++: std::multimap::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::multimap::*)(const float &)) &std::multimap::erase, "C++: std::multimap::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::multimap::*)(class std::multimap &)) &std::multimap::swap, "C++: std::multimap::swap(class std::multimap &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::multimap::*)()) &std::multimap::clear, "C++: std::multimap::clear() --> void"); + cl.def("key_comp", (struct std::less (std::multimap::*)() const) &std::multimap::key_comp, "C++: std::multimap::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::multimap::*)(const float &) const) &std::multimap::count, "C++: std::multimap::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair >, struct std::_Rb_tree_iterator > > (std::multimap::*)(const float &)) &std::multimap::equal_range, "C++: std::multimap::equal_range(const float &) --> struct std::pair >, struct std::_Rb_tree_iterator > >", pybind11::arg("__x")); } { // std::multimap file:bits/stl_multimap.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "multimap_float_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::multimap>>>>(); } ) ); - cl.def( pybind11::init( [](const struct std::less & a0){ return new std::multimap>>>>(a0); } ), "doc" , pybind11::arg("__comp")); - cl.def( pybind11::init &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::multimap>>>> const &o){ return new std::multimap>>>>(o); } ) ); - cl.def("assign", (class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::multimap>>>>::*)(const class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::multimap>>>, std::less, std::allocator>>> > > >::operator=, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::operator=(const class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::get_allocator, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::empty, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::size, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::max_size, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::multimap>>>>::*)(const float &)) &std::multimap>>>, std::less, std::allocator>>> > > >::erase, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("swap", (void (std::multimap>>>>::*)(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::multimap>>>, std::less, std::allocator>>> > > >::swap, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::swap(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::multimap>>>>::*)()) &std::multimap>>>, std::less, std::allocator>>> > > >::clear, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::clear() --> void"); - cl.def("key_comp", (struct std::less (std::multimap>>>>::*)() const) &std::multimap>>>, std::less, std::allocator>>> > > >::key_comp, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::key_comp() const --> struct std::less"); - cl.def("count", (unsigned long (std::multimap>>>>::*)(const float &) const) &std::multimap>>>, std::less, std::allocator>>> > > >::count, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > (std::multimap>>>>::*)(const float &)) &std::multimap>>>, std::less, std::allocator>>> > > >::equal_range, "C++: std::multimap>>>, std::less, std::allocator>>> > > >::equal_range(const float &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >, struct std::_Rb_tree_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >", pybind11::arg("__x")); + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "multimap_float_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::multimap > > >>(); } ) ); + cl.def( pybind11::init( [](const struct std::less & a0){ return new std::multimap > > >>(a0); } ), "doc" , pybind11::arg("__comp")); + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::multimap > > >> const &o){ return new std::multimap > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multimap > > > > & (std::multimap > > >>::*)(const class std::multimap > > > > &)) &std::multimap>>>>::operator=, "C++: std::multimap>>>>::operator=(const class std::multimap > > > > &) --> class std::multimap > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::multimap > > >>::*)() const) &std::multimap>>>>::get_allocator, "C++: std::multimap>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::multimap > > >>::*)() const) &std::multimap>>>>::empty, "C++: std::multimap>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::multimap > > >>::*)() const) &std::multimap>>>>::size, "C++: std::multimap>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::multimap > > >>::*)() const) &std::multimap>>>>::max_size, "C++: std::multimap>>>>::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::multimap > > >>::*)(const float &)) &std::multimap>>>>::erase, "C++: std::multimap>>>>::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("swap", (void (std::multimap > > >>::*)(class std::multimap > > > > &)) &std::multimap>>>>::swap, "C++: std::multimap>>>>::swap(class std::multimap > > > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::multimap > > >>::*)()) &std::multimap>>>>::clear, "C++: std::multimap>>>>::clear() --> void"); + cl.def("key_comp", (struct std::less (std::multimap > > >>::*)() const) &std::multimap>>>>::key_comp, "C++: std::multimap>>>>::key_comp() const --> struct std::less"); + cl.def("count", (unsigned long (std::multimap > > >>::*)(const float &) const) &std::multimap>>>>::count, "C++: std::multimap>>>>::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > > (std::multimap > > >>::*)(const float &)) &std::multimap>>>>::equal_range, "C++: std::multimap>>>>::equal_range(const float &) --> struct std::pair > > > > >, struct std::_Rb_tree_iterator > > > > > >", pybind11::arg("__x")); + } + { // std::unordered_multimap file:bits/unordered_map.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_multimap_float_int_t", ""); + cl.def( pybind11::init( [](){ return new std::unordered_multimap(); } ) ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); + cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::unordered_multimap const &o){ return new std::unordered_multimap(o); } ) ); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__ummap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multimap & (std::unordered_multimap::*)(const class std::unordered_multimap &)) &std::unordered_multimap::operator=, "C++: std::unordered_multimap::operator=(const class std::unordered_multimap &) --> class std::unordered_multimap &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > (std::unordered_multimap::*)() const) &std::unordered_multimap::get_allocator, "C++: std::unordered_multimap::get_allocator() const --> class std::allocator >"); + cl.def("empty", (bool (std::unordered_multimap::*)() const) &std::unordered_multimap::empty, "C++: std::unordered_multimap::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::size, "C++: std::unordered_multimap::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::max_size, "C++: std::unordered_multimap::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::unordered_multimap::*)(const float &)) &std::unordered_multimap::erase, "C++: std::unordered_multimap::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_multimap::*)()) &std::unordered_multimap::clear, "C++: std::unordered_multimap::clear() --> void"); + cl.def("swap", (void (std::unordered_multimap::*)(class std::unordered_multimap &)) &std::unordered_multimap::swap, "C++: std::unordered_multimap::swap(class std::unordered_multimap &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_multimap::*)() const) &std::unordered_multimap::hash_function, "C++: std::unordered_multimap::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_multimap::*)() const) &std::unordered_multimap::key_eq, "C++: std::unordered_multimap::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap::count, "C++: std::unordered_multimap::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_multimap::*)(const float &)) &std::unordered_multimap::equal_range, "C++: std::unordered_multimap::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::bucket_count, "C++: std::unordered_multimap::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap::max_bucket_count, "C++: std::unordered_multimap::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_multimap::*)(unsigned long) const) &std::unordered_multimap::bucket_size, "C++: std::unordered_multimap::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap::bucket, "C++: std::unordered_multimap::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap::load_factor, "C++: std::unordered_multimap::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap::max_load_factor, "C++: std::unordered_multimap::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_multimap::*)(float)) &std::unordered_multimap::max_load_factor, "C++: std::unordered_multimap::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap::rehash, "C++: std::unordered_multimap::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap::reserve, "C++: std::unordered_multimap::reserve(unsigned long) --> void", pybind11::arg("__n")); } } @@ -126,74 +177,51 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_std_unordered_map(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // std::unordered_multimap file:bits/unordered_map.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_multimap_float_int_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multimap(); } ), "doc" ); - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); - cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::unordered_multimap const &o){ return new std::unordered_multimap(o); } ) ); - cl.def("assign", (class std::unordered_multimap, struct std::equal_to, class std::allocator > > & (std::unordered_multimap::*)(const class std::unordered_multimap, struct std::equal_to, class std::allocator > > &)) &std::unordered_multimap, std::equal_to, std::allocator > >::operator=, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::operator=(const class std::unordered_multimap, struct std::equal_to, class std::allocator > > &) --> class std::unordered_multimap, struct std::equal_to, class std::allocator > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator > (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::get_allocator, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::get_allocator() const --> class std::allocator >"); - cl.def("empty", (bool (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::empty, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::unordered_multimap::*)(const float &)) &std::unordered_multimap, std::equal_to, std::allocator > >::erase, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_multimap::*)()) &std::unordered_multimap, std::equal_to, std::allocator > >::clear, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::clear() --> void"); - cl.def("swap", (void (std::unordered_multimap::*)(class std::unordered_multimap, struct std::equal_to, class std::allocator > > &)) &std::unordered_multimap, std::equal_to, std::allocator > >::swap, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::swap(class std::unordered_multimap, struct std::equal_to, class std::allocator > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::hash_function, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::key_eq, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap, std::equal_to, std::allocator > >::count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> > (std::unordered_multimap::*)(const float &)) &std::unordered_multimap, std::equal_to, std::allocator > >::equal_range, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::equal_range(const float &) --> struct std::pair, false, false>, struct std::__detail::_Node_iterator, false, false> >", pybind11::arg("__x")); - cl.def("bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket_count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_bucket_count, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_multimap::*)(unsigned long) const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket_size, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_multimap::*)(const float &) const) &std::unordered_multimap, std::equal_to, std::allocator > >::bucket, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_multimap::*)() const) &std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_multimap::*)(float)) &std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap, std::equal_to, std::allocator > >::rehash, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_multimap::*)(unsigned long)) &std::unordered_multimap, std::equal_to, std::allocator > >::reserve, "C++: std::unordered_multimap, std::equal_to, std::allocator > >::reserve(unsigned long) --> void", pybind11::arg("__n")); - } - { // std::unordered_multimap file:bits/unordered_map.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "unordered_multimap_float_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multimap>>>>(); } ), "doc" ); - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap>>>>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap>>>>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); - cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap>>>>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); - cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::unordered_multimap>>>> const &o){ return new std::unordered_multimap>>>>(o); } ) ); - cl.def("assign", (class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > & (std::unordered_multimap>>>>::*)(const class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::operator=(const class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >"); - cl.def("empty", (bool (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_size() const --> unsigned long"); - cl.def("erase", (unsigned long (std::unordered_multimap>>>>::*)(const float &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_multimap>>>>::*)()) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::clear() --> void"); - cl.def("swap", (void (std::unordered_multimap>>>>::*)(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::swap(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_multimap>>>>::*)(const float &) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, false>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, false> > (std::unordered_multimap>>>>::*)(const float &)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::equal_range(const float &) --> struct std::pair >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, false>, struct std::__detail::_Node_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, false, false> >", pybind11::arg("__x")); - cl.def("bucket_count", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_multimap>>>>::*)(unsigned long) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_multimap>>>>::*)(const float &) const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_multimap>>>>::*)() const) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_multimap>>>>::*)(float)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_multimap>>>>::*)(unsigned long)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_multimap>>>>::*)(unsigned long)) &std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve, "C++: std::unordered_multimap>>>, std::hash, std::equal_to, std::allocator>>> > > >::reserve(unsigned long) --> void", pybind11::arg("__n")); + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "unordered_multimap_float_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::unordered_multimap > > >>(); } ) ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multimap > > >>(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multimap > > >>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); + cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multimap > > >>(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); + cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::unordered_multimap > > >> const &o){ return new std::unordered_multimap > > >>(o); } ) ); + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > > &>(), pybind11::arg("__ummap"), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multimap > > > > & (std::unordered_multimap > > >>::*)(const class std::unordered_multimap > > > > &)) &std::unordered_multimap>>>>::operator=, "C++: std::unordered_multimap>>>>::operator=(const class std::unordered_multimap > > > > &) --> class std::unordered_multimap > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator > > > > > (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::get_allocator, "C++: std::unordered_multimap>>>>::get_allocator() const --> class std::allocator > > > > >"); + cl.def("empty", (bool (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::empty, "C++: std::unordered_multimap>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::size, "C++: std::unordered_multimap>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_size, "C++: std::unordered_multimap>>>>::max_size() const --> unsigned long"); + cl.def("erase", (unsigned long (std::unordered_multimap > > >>::*)(const float &)) &std::unordered_multimap>>>>::erase, "C++: std::unordered_multimap>>>>::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_multimap > > >>::*)()) &std::unordered_multimap>>>>::clear, "C++: std::unordered_multimap>>>>::clear() --> void"); + cl.def("swap", (void (std::unordered_multimap > > >>::*)(class std::unordered_multimap > > > > &)) &std::unordered_multimap>>>>::swap, "C++: std::unordered_multimap>>>>::swap(class std::unordered_multimap > > > > &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::hash_function, "C++: std::unordered_multimap>>>>::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::key_eq, "C++: std::unordered_multimap>>>>::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_multimap > > >>::*)(const float &) const) &std::unordered_multimap>>>>::count, "C++: std::unordered_multimap>>>>::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair > > > >, false, false>, struct std::__detail::_Node_iterator > > > >, false, false> > (std::unordered_multimap > > >>::*)(const float &)) &std::unordered_multimap>>>>::equal_range, "C++: std::unordered_multimap>>>>::equal_range(const float &) --> struct std::pair > > > >, false, false>, struct std::__detail::_Node_iterator > > > >, false, false> >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::bucket_count, "C++: std::unordered_multimap>>>>::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_bucket_count, "C++: std::unordered_multimap>>>>::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_multimap > > >>::*)(unsigned long) const) &std::unordered_multimap>>>>::bucket_size, "C++: std::unordered_multimap>>>>::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_multimap > > >>::*)(const float &) const) &std::unordered_multimap>>>>::bucket, "C++: std::unordered_multimap>>>>::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::load_factor, "C++: std::unordered_multimap>>>>::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_multimap > > >>::*)() const) &std::unordered_multimap>>>>::max_load_factor, "C++: std::unordered_multimap>>>>::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_multimap > > >>::*)(float)) &std::unordered_multimap>>>>::max_load_factor, "C++: std::unordered_multimap>>>>::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_multimap > > >>::*)(unsigned long)) &std::unordered_multimap>>>>::rehash, "C++: std::unordered_multimap>>>>::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_multimap > > >>::*)(unsigned long)) &std::unordered_multimap>>>>::reserve, "C++: std::unordered_multimap>>>>::reserve(unsigned long) --> void", pybind11::arg("__n")); } } @@ -222,24 +250,24 @@ void bind_std_unordered_map(std::function< pybind11::module &(std::string const #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names_multimap(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::multimap, class std::allocator > >) file:T42.stl.names.multimap.hpp line: - M("").def("foo", (void (*)(class std::multimap, class std::allocator > >)) &foo, "C++: foo(class std::multimap, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::multimap) file:T42.stl.names.multimap.hpp line: + M("").def("foo", (void (*)(class std::multimap)) &foo, "C++: foo(class std::multimap) --> void", pybind11::arg("")); - // foo(class std::unordered_multimap, struct std::equal_to, class std::allocator > >) file:T42.stl.names.multimap.hpp line: - M("").def("foo", (void (*)(class std::unordered_multimap, struct std::equal_to, class std::allocator > >)) &foo, "C++: foo(class std::unordered_multimap, struct std::equal_to, class std::allocator > >) --> void", pybind11::arg("")); + // foo(class std::unordered_multimap) file:T42.stl.names.multimap.hpp line: + M("").def("foo", (void (*)(class std::unordered_multimap)) &foo, "C++: foo(class std::unordered_multimap) --> void", pybind11::arg("")); - // foo(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.multimap.hpp line: - M("").def("foo", (void (*)(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::multimap > > > >) file:T42.stl.names.multimap.hpp line: + M("").def("foo", (void (*)(class std::multimap > > > >)) &foo, "C++: foo(class std::multimap > > > >) --> void", pybind11::arg("")); - // foo(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) file:T42.stl.names.multimap.hpp line: - M("").def("foo", (void (*)(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >)) &foo, "C++: foo(class std::unordered_multimap >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::hash, struct std::equal_to, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::unordered_multimap > > > >) file:T42.stl.names.multimap.hpp line: + M("").def("foo", (void (*)(class std::unordered_multimap > > > >)) &foo, "C++: foo(class std::unordered_multimap > > > >) --> void", pybind11::arg("")); } @@ -253,7 +281,7 @@ void bind_T42_stl_names_multimap(std::function< pybind11::module &(std::string c #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -278,14 +306,14 @@ PYBIND11_MODULE(T42_stl_names_multimap, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T42.stl.names.multiset.ref.cpp b/test/T42.stl.names.multiset.ref.cpp index 7b07ff8c..f9424cd0 100644 --- a/test/T42.stl.names.multiset.ref.cpp +++ b/test/T42.stl.names.multiset.ref.cpp @@ -9,8 +9,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -25,6 +25,7 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_float_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); cl.def("__call__", (bool (std::equal_to::*)(const float &, const float &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const float &, const float &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } @@ -50,8 +51,8 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -62,7 +63,6 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init( [](){ return new std::hash(); } ) ); cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); - cl.def("assign", (struct std::hash & (std::hash::*)(const struct std::hash &)) &std::hash::operator=, "C++: std::hash::operator=(const struct std::hash &) --> struct std::hash &", pybind11::return_value_policy::automatic, pybind11::arg("")); } { // std::multiset file:bits/stl_multiset.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "multiset_float_t", ""); @@ -71,14 +71,18 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::multiset const &o){ return new std::multiset(o); } ) ); - cl.def("assign", (class std::multiset, class std::allocator > & (std::multiset::*)(const class std::multiset, class std::allocator > &)) &std::multiset::operator=, "C++: std::multiset::operator=(const class std::multiset, class std::allocator > &) --> class std::multiset, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__m"), pybind11::arg("__a") ); + + cl.def("assign", (class std::multiset & (std::multiset::*)(const class std::multiset &)) &std::multiset::operator=, "C++: std::multiset::operator=(const class std::multiset &) --> class std::multiset &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def("key_comp", (struct std::less (std::multiset::*)() const) &std::multiset::key_comp, "C++: std::multiset::key_comp() const --> struct std::less"); cl.def("value_comp", (struct std::less (std::multiset::*)() const) &std::multiset::value_comp, "C++: std::multiset::value_comp() const --> struct std::less"); cl.def("get_allocator", (class std::allocator (std::multiset::*)() const) &std::multiset::get_allocator, "C++: std::multiset::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::multiset::*)() const) &std::multiset::empty, "C++: std::multiset::empty() const --> bool"); cl.def("size", (unsigned long (std::multiset::*)() const) &std::multiset::size, "C++: std::multiset::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::multiset::*)() const) &std::multiset::max_size, "C++: std::multiset::max_size() const --> unsigned long"); - cl.def("swap", (void (std::multiset::*)(class std::multiset, class std::allocator > &)) &std::multiset::swap, "C++: std::multiset::swap(class std::multiset, class std::allocator > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::multiset::*)(class std::multiset &)) &std::multiset::swap, "C++: std::multiset::swap(class std::multiset &) --> void", pybind11::arg("__x")); cl.def("erase", (unsigned long (std::multiset::*)(const float &)) &std::multiset::erase, "C++: std::multiset::erase(const float &) --> unsigned long", pybind11::arg("__x")); cl.def("clear", (void (std::multiset::*)()) &std::multiset::clear, "C++: std::multiset::clear() --> void"); cl.def("count", (unsigned long (std::multiset::*)(const float &) const) &std::multiset::count, "C++: std::multiset::count(const float &) const --> unsigned long", pybind11::arg("__x")); @@ -86,21 +90,29 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons } { // std::unordered_multiset file:bits/unordered_set.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_multiset_float_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_multiset(); } ), "doc" ); + cl.def( pybind11::init( [](){ return new std::unordered_multiset(); } ) ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_multiset(a0); } ), "doc" , pybind11::arg("__n")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_multiset(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_multiset(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::unordered_multiset const &o){ return new std::unordered_multiset(o); } ) ); - cl.def("assign", (class std::unordered_multiset, struct std::equal_to, class std::allocator > & (std::unordered_multiset::*)(const class std::unordered_multiset, struct std::equal_to, class std::allocator > &)) &std::unordered_multiset::operator=, "C++: std::unordered_multiset::operator=(const class std::unordered_multiset, struct std::equal_to, class std::allocator > &) --> class std::unordered_multiset, struct std::equal_to, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__umset"), pybind11::arg("__a") ); + + cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_multiset & (std::unordered_multiset::*)(const class std::unordered_multiset &)) &std::unordered_multiset::operator=, "C++: std::unordered_multiset::operator=(const class std::unordered_multiset &) --> class std::unordered_multiset &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def("get_allocator", (class std::allocator (std::unordered_multiset::*)() const) &std::unordered_multiset::get_allocator, "C++: std::unordered_multiset::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::unordered_multiset::*)() const) &std::unordered_multiset::empty, "C++: std::unordered_multiset::empty() const --> bool"); cl.def("size", (unsigned long (std::unordered_multiset::*)() const) &std::unordered_multiset::size, "C++: std::unordered_multiset::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::unordered_multiset::*)() const) &std::unordered_multiset::max_size, "C++: std::unordered_multiset::max_size() const --> unsigned long"); cl.def("erase", (unsigned long (std::unordered_multiset::*)(const float &)) &std::unordered_multiset::erase, "C++: std::unordered_multiset::erase(const float &) --> unsigned long", pybind11::arg("__x")); cl.def("clear", (void (std::unordered_multiset::*)()) &std::unordered_multiset::clear, "C++: std::unordered_multiset::clear() --> void"); - cl.def("swap", (void (std::unordered_multiset::*)(class std::unordered_multiset, struct std::equal_to, class std::allocator > &)) &std::unordered_multiset::swap, "C++: std::unordered_multiset::swap(class std::unordered_multiset, struct std::equal_to, class std::allocator > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::unordered_multiset::*)(class std::unordered_multiset &)) &std::unordered_multiset::swap, "C++: std::unordered_multiset::swap(class std::unordered_multiset &) --> void", pybind11::arg("__x")); cl.def("hash_function", (struct std::hash (std::unordered_multiset::*)() const) &std::unordered_multiset::hash_function, "C++: std::unordered_multiset::hash_function() const --> struct std::hash"); cl.def("key_eq", (struct std::equal_to (std::unordered_multiset::*)() const) &std::unordered_multiset::key_eq, "C++: std::unordered_multiset::key_eq() const --> struct std::equal_to"); cl.def("count", (unsigned long (std::unordered_multiset::*)(const float &) const) &std::unordered_multiset::count, "C++: std::unordered_multiset::count(const float &) const --> unsigned long", pybind11::arg("__x")); @@ -137,18 +149,18 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names_multiset(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::multiset, class std::allocator >) file:T42.stl.names.multiset.hpp line: - M("").def("foo", (void (*)(class std::multiset, class std::allocator >)) &foo, "C++: foo(class std::multiset, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::multiset) file:T42.stl.names.multiset.hpp line: + M("").def("foo", (void (*)(class std::multiset)) &foo, "C++: foo(class std::multiset) --> void", pybind11::arg("")); - // foo(class std::unordered_multiset, struct std::equal_to, class std::allocator >) file:T42.stl.names.multiset.hpp line: - M("").def("foo", (void (*)(class std::unordered_multiset, struct std::equal_to, class std::allocator >)) &foo, "C++: foo(class std::unordered_multiset, struct std::equal_to, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::unordered_multiset) file:T42.stl.names.multiset.hpp line: + M("").def("foo", (void (*)(class std::unordered_multiset)) &foo, "C++: foo(class std::unordered_multiset) --> void", pybind11::arg("")); } @@ -162,7 +174,7 @@ void bind_T42_stl_names_multiset(std::function< pybind11::module &(std::string c #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -186,14 +198,14 @@ PYBIND11_MODULE(T42_stl_names_multiset, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T42.stl.names.ref.cpp b/test/T42.stl.names.ref.cpp index 2ceaa269..d7c739cd 100644 --- a/test/T42.stl.names.ref.cpp +++ b/test/T42.stl.names.ref.cpp @@ -1,7 +1,11 @@ // File: std/stl_deque.cpp #include // std::deque +#include // std::forward_list +#include // __gnu_cxx::__normal_iterator +#include // std::list #include // std::allocator #include // __str__ +#include // std::vector #include #include @@ -9,8 +13,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -21,13 +25,16 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam cl.def( pybind11::init( [](){ return new std::deque(); } ) ); cl.def( pybind11::init &>(), pybind11::arg("__a") ); - cl.def( pybind11::init(), pybind11::arg("__n") ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::deque(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__a") ); cl.def( pybind11::init( [](unsigned long const & a0, const int & a1){ return new std::deque(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::deque const &o){ return new std::deque(o); } ) ); - cl.def("assign", (class std::deque > & (std::deque::*)(const class std::deque > &)) &std::deque::operator=, "C++: std::deque::operator=(const class std::deque > &) --> class std::deque > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::deque & (std::deque::*)(const class std::deque &)) &std::deque::operator=, "C++: std::deque::operator=(const class std::deque &) --> class std::deque &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); cl.def("assign", (void (std::deque::*)(unsigned long, const int &)) &std::deque::assign, "C++: std::deque::assign(unsigned long, const int &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); cl.def("get_allocator", (class std::allocator (std::deque::*)() const) &std::deque::get_allocator, "C++: std::deque::get_allocator() const --> class std::allocator"); cl.def("size", (unsigned long (std::deque::*)() const) &std::deque::size, "C++: std::deque::size() const --> unsigned long"); @@ -44,39 +51,15 @@ void bind_std_stl_deque(std::function< pybind11::module &(std::string const &nam cl.def("push_back", (void (std::deque::*)(const int &)) &std::deque::push_back, "C++: std::deque::push_back(const int &) --> void", pybind11::arg("__x")); cl.def("pop_front", (void (std::deque::*)()) &std::deque::pop_front, "C++: std::deque::pop_front() --> void"); cl.def("pop_back", (void (std::deque::*)()) &std::deque::pop_back, "C++: std::deque::pop_back() --> void"); - cl.def("swap", (void (std::deque::*)(class std::deque > &)) &std::deque::swap, "C++: std::deque::swap(class std::deque > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::deque::*)(class std::deque &)) &std::deque::swap, "C++: std::deque::swap(class std::deque &) --> void", pybind11::arg("__x")); cl.def("clear", (void (std::deque::*)()) &std::deque::clear, "C++: std::deque::clear() --> void"); } -} - - -// File: std/forward_list.cpp -#include // std::forward_list -#include // __gnu_cxx::__normal_iterator -#include // std::list -#include // std::allocator -#include // __str__ -#include // std::vector - -#include -#include -#include - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_std_forward_list(std::function< pybind11::module &(std::string const &namespace_) > &M) -{ { // std::forward_list file:bits/forward_list.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "forward_list_float_t", ""); - cl.def( pybind11::init( [](){ return new std::forward_list(); } ), "doc" ); + cl.def( pybind11::init( [](){ return new std::forward_list(); } ) ); cl.def( pybind11::init &>(), pybind11::arg("__al") ); - cl.def( pybind11::init > &, const class std::allocator &>(), pybind11::arg("__list"), pybind11::arg("__al") ); + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__list"), pybind11::arg("__al") ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::forward_list(a0); } ), "doc" , pybind11::arg("__n")); cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__al") ); @@ -85,7 +68,7 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__al") ); cl.def( pybind11::init( [](std::forward_list const &o){ return new std::forward_list(o); } ) ); - cl.def("assign", (class std::forward_list > & (std::forward_list::*)(const class std::forward_list > &)) &std::forward_list::operator=, "C++: std::forward_list::operator=(const class std::forward_list > &) --> class std::forward_list > &", pybind11::return_value_policy::automatic, pybind11::arg("__list")); + cl.def("assign", (class std::forward_list & (std::forward_list::*)(const class std::forward_list &)) &std::forward_list::operator=, "C++: std::forward_list::operator=(const class std::forward_list &) --> class std::forward_list &", pybind11::return_value_policy::automatic, pybind11::arg("__list")); cl.def("assign", (void (std::forward_list::*)(unsigned long, const float &)) &std::forward_list::assign, "C++: std::forward_list::assign(unsigned long, const float &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); cl.def("get_allocator", (class std::allocator (std::forward_list::*)() const) &std::forward_list::get_allocator, "C++: std::forward_list::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::forward_list::*)() const) &std::forward_list::empty, "C++: std::forward_list::empty() const --> bool"); @@ -93,13 +76,13 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def("front", (float & (std::forward_list::*)()) &std::forward_list::front, "C++: std::forward_list::front() --> float &", pybind11::return_value_policy::automatic); cl.def("push_front", (void (std::forward_list::*)(const float &)) &std::forward_list::push_front, "C++: std::forward_list::push_front(const float &) --> void", pybind11::arg("__val")); cl.def("pop_front", (void (std::forward_list::*)()) &std::forward_list::pop_front, "C++: std::forward_list::pop_front() --> void"); - cl.def("swap", (void (std::forward_list::*)(class std::forward_list > &)) &std::forward_list::swap, "C++: std::forward_list::swap(class std::forward_list > &) --> void", pybind11::arg("__list")); + cl.def("swap", (void (std::forward_list::*)(class std::forward_list &)) &std::forward_list::swap, "C++: std::forward_list::swap(class std::forward_list &) --> void", pybind11::arg("__list")); cl.def("resize", (void (std::forward_list::*)(unsigned long)) &std::forward_list::resize, "C++: std::forward_list::resize(unsigned long) --> void", pybind11::arg("__sz")); cl.def("resize", (void (std::forward_list::*)(unsigned long, const float &)) &std::forward_list::resize, "C++: std::forward_list::resize(unsigned long, const float &) --> void", pybind11::arg("__sz"), pybind11::arg("__val")); cl.def("clear", (void (std::forward_list::*)()) &std::forward_list::clear, "C++: std::forward_list::clear() --> void"); cl.def("remove", (void (std::forward_list::*)(const float &)) &std::forward_list::remove, "C++: std::forward_list::remove(const float &) --> void", pybind11::arg("__val")); cl.def("unique", (void (std::forward_list::*)()) &std::forward_list::unique, "C++: std::forward_list::unique() --> void"); - cl.def("merge", (void (std::forward_list::*)(class std::forward_list > &)) &std::forward_list::merge, "C++: std::forward_list::merge(class std::forward_list > &) --> void", pybind11::arg("__list")); + cl.def("merge", (void (std::forward_list::*)(class std::forward_list &)) &std::forward_list::merge, "C++: std::forward_list::merge(class std::forward_list &) --> void", pybind11::arg("__list")); cl.def("sort", (void (std::forward_list::*)()) &std::forward_list::sort, "C++: std::forward_list::sort() --> void"); cl.def("reverse", (void (std::forward_list::*)()) &std::forward_list::reverse, "C++: std::forward_list::reverse() --> void"); } @@ -108,13 +91,16 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def( pybind11::init( [](){ return new std::list(); } ) ); cl.def( pybind11::init &>(), pybind11::arg("__a") ); - cl.def( pybind11::init(), pybind11::arg("__n") ); + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::list(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__a") ); cl.def( pybind11::init( [](unsigned long const & a0, const double & a1){ return new std::list(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::list const &o){ return new std::list(o); } ) ); - cl.def("assign", (class std::list > & (std::list::*)(const class std::list > &)) &std::list::operator=, "C++: std::list::operator=(const class std::list > &) --> class std::list > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::list & (std::list::*)(const class std::list &)) &std::list::operator=, "C++: std::list::operator=(const class std::list &) --> class std::list &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); cl.def("assign", (void (std::list::*)(unsigned long, const double &)) &std::list::assign, "C++: std::list::assign(unsigned long, const double &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); cl.def("get_allocator", (class std::allocator (std::list::*)() const) &std::list::get_allocator, "C++: std::list::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::list::*)() const) &std::list::empty, "C++: std::list::empty() const --> bool"); @@ -128,11 +114,11 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def("pop_front", (void (std::list::*)()) &std::list::pop_front, "C++: std::list::pop_front() --> void"); cl.def("push_back", (void (std::list::*)(const double &)) &std::list::push_back, "C++: std::list::push_back(const double &) --> void", pybind11::arg("__x")); cl.def("pop_back", (void (std::list::*)()) &std::list::pop_back, "C++: std::list::pop_back() --> void"); - cl.def("swap", (void (std::list::*)(class std::list > &)) &std::list::swap, "C++: std::list::swap(class std::list > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::list::*)(class std::list &)) &std::list::swap, "C++: std::list::swap(class std::list &) --> void", pybind11::arg("__x")); cl.def("clear", (void (std::list::*)()) &std::list::clear, "C++: std::list::clear() --> void"); cl.def("remove", (void (std::list::*)(const double &)) &std::list::remove, "C++: std::list::remove(const double &) --> void", pybind11::arg("__value")); cl.def("unique", (void (std::list::*)()) &std::list::unique, "C++: std::list::unique() --> void"); - cl.def("merge", (void (std::list::*)(class std::list > &)) &std::list::merge, "C++: std::list::merge(class std::list > &) --> void", pybind11::arg("__x")); + cl.def("merge", (void (std::list::*)(class std::list &)) &std::list::merge, "C++: std::list::merge(class std::list &) --> void", pybind11::arg("__x")); cl.def("reverse", (void (std::list::*)()) &std::list::reverse, "C++: std::list::reverse() --> void"); cl.def("sort", (void (std::list::*)()) &std::list::sort, "C++: std::list::sort() --> void"); } @@ -148,14 +134,14 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::vector const &o){ return new std::vector(o); } ) ); - cl.def( pybind11::init > &, const class std::allocator &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__x"), pybind11::arg("__a") ); - cl.def("assign", (class std::vector > & (std::vector::*)(const class std::vector > &)) &std::vector::operator=, "C++: std::vector::operator=(const class std::vector > &) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def("assign", (class std::vector & (std::vector::*)(const class std::vector &)) &std::vector::operator=, "C++: std::vector::operator=(const class std::vector &) --> class std::vector &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); cl.def("assign", (void (std::vector::*)(unsigned long, const double &)) &std::vector::assign, "C++: std::vector::assign(unsigned long, const double &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); - cl.def("begin", (class __gnu_cxx::__normal_iterator > > (std::vector::*)()) &std::vector::begin, "C++: std::vector::begin() --> class __gnu_cxx::__normal_iterator > >"); - cl.def("end", (class __gnu_cxx::__normal_iterator > > (std::vector::*)()) &std::vector::end, "C++: std::vector::end() --> class __gnu_cxx::__normal_iterator > >"); - cl.def("cbegin", (class __gnu_cxx::__normal_iterator > > (std::vector::*)() const) &std::vector::cbegin, "C++: std::vector::cbegin() const --> class __gnu_cxx::__normal_iterator > >"); - cl.def("cend", (class __gnu_cxx::__normal_iterator > > (std::vector::*)() const) &std::vector::cend, "C++: std::vector::cend() const --> class __gnu_cxx::__normal_iterator > >"); + cl.def("begin", (class __gnu_cxx::__normal_iterator > (std::vector::*)()) &std::vector::begin, "C++: std::vector::begin() --> class __gnu_cxx::__normal_iterator >"); + cl.def("end", (class __gnu_cxx::__normal_iterator > (std::vector::*)()) &std::vector::end, "C++: std::vector::end() --> class __gnu_cxx::__normal_iterator >"); + cl.def("cbegin", (class __gnu_cxx::__normal_iterator > (std::vector::*)() const) &std::vector::cbegin, "C++: std::vector::cbegin() const --> class __gnu_cxx::__normal_iterator >"); + cl.def("cend", (class __gnu_cxx::__normal_iterator > (std::vector::*)() const) &std::vector::cend, "C++: std::vector::cend() const --> class __gnu_cxx::__normal_iterator >"); cl.def("size", (unsigned long (std::vector::*)() const) &std::vector::size, "C++: std::vector::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::vector::*)() const) &std::vector::max_size, "C++: std::vector::max_size() const --> unsigned long"); cl.def("resize", (void (std::vector::*)(unsigned long)) &std::vector::resize, "C++: std::vector::resize(unsigned long) --> void", pybind11::arg("__new_size")); @@ -171,11 +157,11 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & cl.def("data", (double * (std::vector::*)()) &std::vector::data, "C++: std::vector::data() --> double *", pybind11::return_value_policy::automatic); cl.def("push_back", (void (std::vector::*)(const double &)) &std::vector::push_back, "C++: std::vector::push_back(const double &) --> void", pybind11::arg("__x")); cl.def("pop_back", (void (std::vector::*)()) &std::vector::pop_back, "C++: std::vector::pop_back() --> void"); - cl.def("insert", (class __gnu_cxx::__normal_iterator > > (std::vector::*)(class __gnu_cxx::__normal_iterator > >, const double &)) &std::vector::insert, "C++: std::vector::insert(class __gnu_cxx::__normal_iterator > >, const double &) --> class __gnu_cxx::__normal_iterator > >", pybind11::arg("__position"), pybind11::arg("__x")); - cl.def("insert", (void (std::vector::*)(class __gnu_cxx::__normal_iterator > >, unsigned long, const double &)) &std::vector::insert, "C++: std::vector::insert(class __gnu_cxx::__normal_iterator > >, unsigned long, const double &) --> void", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); - cl.def("erase", (class __gnu_cxx::__normal_iterator > > (std::vector::*)(class __gnu_cxx::__normal_iterator > >)) &std::vector::erase, "C++: std::vector::erase(class __gnu_cxx::__normal_iterator > >) --> class __gnu_cxx::__normal_iterator > >", pybind11::arg("__position")); - cl.def("erase", (class __gnu_cxx::__normal_iterator > > (std::vector::*)(class __gnu_cxx::__normal_iterator > >, class __gnu_cxx::__normal_iterator > >)) &std::vector::erase, "C++: std::vector::erase(class __gnu_cxx::__normal_iterator > >, class __gnu_cxx::__normal_iterator > >) --> class __gnu_cxx::__normal_iterator > >", pybind11::arg("__first"), pybind11::arg("__last")); - cl.def("swap", (void (std::vector::*)(class std::vector > &)) &std::vector::swap, "C++: std::vector::swap(class std::vector > &) --> void", pybind11::arg("__x")); + cl.def("insert", (class __gnu_cxx::__normal_iterator > (std::vector::*)(class __gnu_cxx::__normal_iterator >, const double &)) &std::vector::insert, "C++: std::vector::insert(class __gnu_cxx::__normal_iterator >, const double &) --> class __gnu_cxx::__normal_iterator >", pybind11::arg("__position"), pybind11::arg("__x")); + cl.def("insert", (class __gnu_cxx::__normal_iterator > (std::vector::*)(class __gnu_cxx::__normal_iterator >, unsigned long, const double &)) &std::vector::insert, "C++: std::vector::insert(class __gnu_cxx::__normal_iterator >, unsigned long, const double &) --> class __gnu_cxx::__normal_iterator >", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); + cl.def("erase", (class __gnu_cxx::__normal_iterator > (std::vector::*)(class __gnu_cxx::__normal_iterator >)) &std::vector::erase, "C++: std::vector::erase(class __gnu_cxx::__normal_iterator >) --> class __gnu_cxx::__normal_iterator >", pybind11::arg("__position")); + cl.def("erase", (class __gnu_cxx::__normal_iterator > (std::vector::*)(class __gnu_cxx::__normal_iterator >, class __gnu_cxx::__normal_iterator >)) &std::vector::erase, "C++: std::vector::erase(class __gnu_cxx::__normal_iterator >, class __gnu_cxx::__normal_iterator >) --> class __gnu_cxx::__normal_iterator >", pybind11::arg("__first"), pybind11::arg("__last")); + cl.def("swap", (void (std::vector::*)(class std::vector &)) &std::vector::swap, "C++: std::vector::swap(class std::vector &) --> void", pybind11::arg("__x")); cl.def("clear", (void (std::vector::*)()) &std::vector::clear, "C++: std::vector::clear() --> void"); } } @@ -193,8 +179,8 @@ void bind_std_forward_list(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -203,86 +189,86 @@ void bind_std_stl_vector(std::function< pybind11::module &(std::string const &na { // std::vector file:bits/stl_vector.h line: pybind11::class_>, std::shared_ptr>>> cl(M("std"), "vector_std_vector_double_t", ""); cl.def( pybind11::init( [](){ return new std::vector>(); } ) ); - cl.def( pybind11::init > > &>(), pybind11::arg("__a") ); + cl.def( pybind11::init > &>(), pybind11::arg("__a") ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::vector>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + cl.def( pybind11::init > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); - cl.def( pybind11::init( [](unsigned long const & a0, const class std::vector > & a1){ return new std::vector>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); - cl.def( pybind11::init > &, const class std::allocator > > &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); + cl.def( pybind11::init( [](unsigned long const & a0, const class std::vector & a1){ return new std::vector>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); + cl.def( pybind11::init &, const class std::allocator > &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::vector> const &o){ return new std::vector>(o); } ) ); - cl.def( pybind11::init >, class std::allocator > > > &, const class std::allocator > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); - - cl.def("assign", (class std::vector >, class std::allocator > > > & (std::vector>::*)(const class std::vector >, class std::allocator > > > &)) &std::vector>::operator=, "C++: std::vector>::operator=(const class std::vector >, class std::allocator > > > &) --> class std::vector >, class std::allocator > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("assign", (void (std::vector>::*)(unsigned long, const class std::vector > &)) &std::vector>::assign, "C++: std::vector>::assign(unsigned long, const class std::vector > &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); - cl.def("begin", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)()) &std::vector>::begin, "C++: std::vector>::begin() --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >"); - cl.def("end", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)()) &std::vector>::end, "C++: std::vector>::end() --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >"); - cl.def("cbegin", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)() const) &std::vector>::cbegin, "C++: std::vector>::cbegin() const --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >"); - cl.def("cend", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)() const) &std::vector>::cend, "C++: std::vector>::cend() const --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >"); + cl.def( pybind11::init > &, const class std::allocator > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::vector > & (std::vector>::*)(const class std::vector > &)) &std::vector>::operator=, "C++: std::vector>::operator=(const class std::vector > &) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def("assign", (void (std::vector>::*)(unsigned long, const class std::vector &)) &std::vector>::assign, "C++: std::vector>::assign(unsigned long, const class std::vector &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); + cl.def("begin", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)()) &std::vector>::begin, "C++: std::vector>::begin() --> class __gnu_cxx::__normal_iterator *, class std::vector > >"); + cl.def("end", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)()) &std::vector>::end, "C++: std::vector>::end() --> class __gnu_cxx::__normal_iterator *, class std::vector > >"); + cl.def("cbegin", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)() const) &std::vector>::cbegin, "C++: std::vector>::cbegin() const --> class __gnu_cxx::__normal_iterator *, class std::vector > >"); + cl.def("cend", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)() const) &std::vector>::cend, "C++: std::vector>::cend() const --> class __gnu_cxx::__normal_iterator *, class std::vector > >"); cl.def("size", (unsigned long (std::vector>::*)() const) &std::vector>::size, "C++: std::vector>::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::vector>::*)() const) &std::vector>::max_size, "C++: std::vector>::max_size() const --> unsigned long"); cl.def("resize", (void (std::vector>::*)(unsigned long)) &std::vector>::resize, "C++: std::vector>::resize(unsigned long) --> void", pybind11::arg("__new_size")); - cl.def("resize", (void (std::vector>::*)(unsigned long, const class std::vector > &)) &std::vector>::resize, "C++: std::vector>::resize(unsigned long, const class std::vector > &) --> void", pybind11::arg("__new_size"), pybind11::arg("__x")); + cl.def("resize", (void (std::vector>::*)(unsigned long, const class std::vector &)) &std::vector>::resize, "C++: std::vector>::resize(unsigned long, const class std::vector &) --> void", pybind11::arg("__new_size"), pybind11::arg("__x")); cl.def("shrink_to_fit", (void (std::vector>::*)()) &std::vector>::shrink_to_fit, "C++: std::vector>::shrink_to_fit() --> void"); cl.def("capacity", (unsigned long (std::vector>::*)() const) &std::vector>::capacity, "C++: std::vector>::capacity() const --> unsigned long"); cl.def("empty", (bool (std::vector>::*)() const) &std::vector>::empty, "C++: std::vector>::empty() const --> bool"); cl.def("reserve", (void (std::vector>::*)(unsigned long)) &std::vector>::reserve, "C++: std::vector>::reserve(unsigned long) --> void", pybind11::arg("__n")); - cl.def("__getitem__", (class std::vector > & (std::vector>::*)(unsigned long)) &std::vector>::operator[], "C++: std::vector>::operator[](unsigned long) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (class std::vector > & (std::vector>::*)(unsigned long)) &std::vector>::at, "C++: std::vector>::at(unsigned long) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (class std::vector > & (std::vector>::*)()) &std::vector>::front, "C++: std::vector>::front() --> class std::vector > &", pybind11::return_value_policy::automatic); - cl.def("back", (class std::vector > & (std::vector>::*)()) &std::vector>::back, "C++: std::vector>::back() --> class std::vector > &", pybind11::return_value_policy::automatic); - cl.def("data", (class std::vector > * (std::vector>::*)()) &std::vector>::data, "C++: std::vector>::data() --> class std::vector > *", pybind11::return_value_policy::automatic); - cl.def("push_back", (void (std::vector>::*)(const class std::vector > &)) &std::vector>::push_back, "C++: std::vector>::push_back(const class std::vector > &) --> void", pybind11::arg("__x")); + cl.def("__getitem__", (class std::vector & (std::vector>::*)(unsigned long)) &std::vector>::operator[], "C++: std::vector>::operator[](unsigned long) --> class std::vector &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (class std::vector & (std::vector>::*)(unsigned long)) &std::vector>::at, "C++: std::vector>::at(unsigned long) --> class std::vector &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (class std::vector & (std::vector>::*)()) &std::vector>::front, "C++: std::vector>::front() --> class std::vector &", pybind11::return_value_policy::automatic); + cl.def("back", (class std::vector & (std::vector>::*)()) &std::vector>::back, "C++: std::vector>::back() --> class std::vector &", pybind11::return_value_policy::automatic); + cl.def("data", (class std::vector * (std::vector>::*)()) &std::vector>::data, "C++: std::vector>::data() --> class std::vector *", pybind11::return_value_policy::automatic); + cl.def("push_back", (void (std::vector>::*)(const class std::vector &)) &std::vector>::push_back, "C++: std::vector>::push_back(const class std::vector &) --> void", pybind11::arg("__x")); cl.def("pop_back", (void (std::vector>::*)()) &std::vector>::pop_back, "C++: std::vector>::pop_back() --> void"); - cl.def("insert", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, const class std::vector > &)) &std::vector>::insert, "C++: std::vector>::insert(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, const class std::vector > &) --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >", pybind11::arg("__position"), pybind11::arg("__x")); - cl.def("insert", (void (std::vector>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, unsigned long, const class std::vector > &)) &std::vector>::insert, "C++: std::vector>::insert(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, unsigned long, const class std::vector > &) --> void", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); - cl.def("erase", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >)) &std::vector>::erase, "C++: std::vector>::erase(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >) --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >", pybind11::arg("__position")); - cl.def("erase", (class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > > (std::vector>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >)) &std::vector>::erase, "C++: std::vector>::erase(class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >, class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >) --> class __gnu_cxx::__normal_iterator > *, class std::vector >, class std::allocator > > > >", pybind11::arg("__first"), pybind11::arg("__last")); - cl.def("swap", (void (std::vector>::*)(class std::vector >, class std::allocator > > > &)) &std::vector>::swap, "C++: std::vector>::swap(class std::vector >, class std::allocator > > > &) --> void", pybind11::arg("__x")); + cl.def("insert", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)(class __gnu_cxx::__normal_iterator *, class std::vector > >, const class std::vector &)) &std::vector>::insert, "C++: std::vector>::insert(class __gnu_cxx::__normal_iterator *, class std::vector > >, const class std::vector &) --> class __gnu_cxx::__normal_iterator *, class std::vector > >", pybind11::arg("__position"), pybind11::arg("__x")); + cl.def("insert", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)(class __gnu_cxx::__normal_iterator *, class std::vector > >, unsigned long, const class std::vector &)) &std::vector>::insert, "C++: std::vector>::insert(class __gnu_cxx::__normal_iterator *, class std::vector > >, unsigned long, const class std::vector &) --> class __gnu_cxx::__normal_iterator *, class std::vector > >", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); + cl.def("erase", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)(class __gnu_cxx::__normal_iterator *, class std::vector > >)) &std::vector>::erase, "C++: std::vector>::erase(class __gnu_cxx::__normal_iterator *, class std::vector > >) --> class __gnu_cxx::__normal_iterator *, class std::vector > >", pybind11::arg("__position")); + cl.def("erase", (class __gnu_cxx::__normal_iterator *, class std::vector > > (std::vector>::*)(class __gnu_cxx::__normal_iterator *, class std::vector > >, class __gnu_cxx::__normal_iterator *, class std::vector > >)) &std::vector>::erase, "C++: std::vector>::erase(class __gnu_cxx::__normal_iterator *, class std::vector > >, class __gnu_cxx::__normal_iterator *, class std::vector > >) --> class __gnu_cxx::__normal_iterator *, class std::vector > >", pybind11::arg("__first"), pybind11::arg("__last")); + cl.def("swap", (void (std::vector>::*)(class std::vector > &)) &std::vector>::swap, "C++: std::vector>::swap(class std::vector > &) --> void", pybind11::arg("__x")); cl.def("clear", (void (std::vector>::*)()) &std::vector>::clear, "C++: std::vector>::clear() --> void"); } { // std::vector file:bits/stl_vector.h line: - pybind11::class_>>, std::shared_ptr>>>> cl(M("std"), "vector_std_vector_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::vector>>(); } ) ); - cl.def( pybind11::init >, class std::allocator > > > > &>(), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::vector>>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init >, class std::allocator > > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](unsigned long const & a0, const class std::vector >, class std::allocator > > > & a1){ return new std::vector>>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); - cl.def( pybind11::init >, class std::allocator > > > &, const class std::allocator >, class std::allocator > > > > &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::vector>> const &o){ return new std::vector>>(o); } ) ); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &, const class std::allocator >, class std::allocator > > > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); - - cl.def("assign", (class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::vector>>::*)(const class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &)) &std::vector>>::operator=, "C++: std::vector>>::operator=(const class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &) --> class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("assign", (void (std::vector>>::*)(unsigned long, const class std::vector >, class std::allocator > > > &)) &std::vector>>::assign, "C++: std::vector>>::assign(unsigned long, const class std::vector >, class std::allocator > > > &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); - cl.def("begin", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)()) &std::vector>>::begin, "C++: std::vector>>::begin() --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >"); - cl.def("end", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)()) &std::vector>>::end, "C++: std::vector>>::end() --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >"); - cl.def("cbegin", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)() const) &std::vector>>::cbegin, "C++: std::vector>>::cbegin() const --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >"); - cl.def("cend", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)() const) &std::vector>>::cend, "C++: std::vector>>::cend() const --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >"); - cl.def("size", (unsigned long (std::vector>>::*)() const) &std::vector>>::size, "C++: std::vector>>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::vector>>::*)() const) &std::vector>>::max_size, "C++: std::vector>>::max_size() const --> unsigned long"); - cl.def("resize", (void (std::vector>>::*)(unsigned long)) &std::vector>>::resize, "C++: std::vector>>::resize(unsigned long) --> void", pybind11::arg("__new_size")); - cl.def("resize", (void (std::vector>>::*)(unsigned long, const class std::vector >, class std::allocator > > > &)) &std::vector>>::resize, "C++: std::vector>>::resize(unsigned long, const class std::vector >, class std::allocator > > > &) --> void", pybind11::arg("__new_size"), pybind11::arg("__x")); - cl.def("shrink_to_fit", (void (std::vector>>::*)()) &std::vector>>::shrink_to_fit, "C++: std::vector>>::shrink_to_fit() --> void"); - cl.def("capacity", (unsigned long (std::vector>>::*)() const) &std::vector>>::capacity, "C++: std::vector>>::capacity() const --> unsigned long"); - cl.def("empty", (bool (std::vector>>::*)() const) &std::vector>>::empty, "C++: std::vector>>::empty() const --> bool"); - cl.def("reserve", (void (std::vector>>::*)(unsigned long)) &std::vector>>::reserve, "C++: std::vector>>::reserve(unsigned long) --> void", pybind11::arg("__n")); - cl.def("__getitem__", (class std::vector >, class std::allocator > > > & (std::vector>>::*)(unsigned long)) &std::vector>>::operator[], "C++: std::vector>>::operator[](unsigned long) --> class std::vector >, class std::allocator > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (class std::vector >, class std::allocator > > > & (std::vector>>::*)(unsigned long)) &std::vector>>::at, "C++: std::vector>>::at(unsigned long) --> class std::vector >, class std::allocator > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (class std::vector >, class std::allocator > > > & (std::vector>>::*)()) &std::vector>>::front, "C++: std::vector>>::front() --> class std::vector >, class std::allocator > > > &", pybind11::return_value_policy::automatic); - cl.def("back", (class std::vector >, class std::allocator > > > & (std::vector>>::*)()) &std::vector>>::back, "C++: std::vector>>::back() --> class std::vector >, class std::allocator > > > &", pybind11::return_value_policy::automatic); - cl.def("data", (class std::vector >, class std::allocator > > > * (std::vector>>::*)()) &std::vector>>::data, "C++: std::vector>>::data() --> class std::vector >, class std::allocator > > > *", pybind11::return_value_policy::automatic); - cl.def("push_back", (void (std::vector>>::*)(const class std::vector >, class std::allocator > > > &)) &std::vector>>::push_back, "C++: std::vector>>::push_back(const class std::vector >, class std::allocator > > > &) --> void", pybind11::arg("__x")); - cl.def("pop_back", (void (std::vector>>::*)()) &std::vector>>::pop_back, "C++: std::vector>>::pop_back() --> void"); - cl.def("insert", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, const class std::vector >, class std::allocator > > > &)) &std::vector>>::insert, "C++: std::vector>>::insert(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, const class std::vector >, class std::allocator > > > &) --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >", pybind11::arg("__position"), pybind11::arg("__x")); - cl.def("insert", (void (std::vector>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, unsigned long, const class std::vector >, class std::allocator > > > &)) &std::vector>>::insert, "C++: std::vector>>::insert(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, unsigned long, const class std::vector >, class std::allocator > > > &) --> void", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); - cl.def("erase", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >)) &std::vector>>::erase, "C++: std::vector>>::erase(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >) --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >", pybind11::arg("__position")); - cl.def("erase", (class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > (std::vector>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >)) &std::vector>>::erase, "C++: std::vector>>::erase(class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >, class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >) --> class __gnu_cxx::__normal_iterator >, class std::allocator > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > >", pybind11::arg("__first"), pybind11::arg("__last")); - cl.def("swap", (void (std::vector>>::*)(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &)) &std::vector>>::swap, "C++: std::vector>>::swap(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::vector>>::*)()) &std::vector>>::clear, "C++: std::vector>>::clear() --> void"); + pybind11::class_ >>, std::shared_ptr >>>> cl(M("std"), "vector_std_vector_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::vector >>(); } ) ); + cl.def( pybind11::init > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::vector >>(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](unsigned long const & a0, const class std::vector > & a1){ return new std::vector >>(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__value")); + cl.def( pybind11::init > &, const class std::allocator > > &>(), pybind11::arg("__n"), pybind11::arg("__value"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::vector >> const &o){ return new std::vector >>(o); } ) ); + cl.def( pybind11::init > > &, const class std::allocator > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::vector > > & (std::vector >>::*)(const class std::vector > > &)) &std::vector>>::operator=, "C++: std::vector>>::operator=(const class std::vector > > &) --> class std::vector > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def("assign", (void (std::vector >>::*)(unsigned long, const class std::vector > &)) &std::vector>>::assign, "C++: std::vector>>::assign(unsigned long, const class std::vector > &) --> void", pybind11::arg("__n"), pybind11::arg("__val")); + cl.def("begin", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)()) &std::vector>>::begin, "C++: std::vector>>::begin() --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >"); + cl.def("end", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)()) &std::vector>>::end, "C++: std::vector>>::end() --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >"); + cl.def("cbegin", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)() const) &std::vector>>::cbegin, "C++: std::vector>>::cbegin() const --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >"); + cl.def("cend", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)() const) &std::vector>>::cend, "C++: std::vector>>::cend() const --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >"); + cl.def("size", (unsigned long (std::vector >>::*)() const) &std::vector>>::size, "C++: std::vector>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::vector >>::*)() const) &std::vector>>::max_size, "C++: std::vector>>::max_size() const --> unsigned long"); + cl.def("resize", (void (std::vector >>::*)(unsigned long)) &std::vector>>::resize, "C++: std::vector>>::resize(unsigned long) --> void", pybind11::arg("__new_size")); + cl.def("resize", (void (std::vector >>::*)(unsigned long, const class std::vector > &)) &std::vector>>::resize, "C++: std::vector>>::resize(unsigned long, const class std::vector > &) --> void", pybind11::arg("__new_size"), pybind11::arg("__x")); + cl.def("shrink_to_fit", (void (std::vector >>::*)()) &std::vector>>::shrink_to_fit, "C++: std::vector>>::shrink_to_fit() --> void"); + cl.def("capacity", (unsigned long (std::vector >>::*)() const) &std::vector>>::capacity, "C++: std::vector>>::capacity() const --> unsigned long"); + cl.def("empty", (bool (std::vector >>::*)() const) &std::vector>>::empty, "C++: std::vector>>::empty() const --> bool"); + cl.def("reserve", (void (std::vector >>::*)(unsigned long)) &std::vector>>::reserve, "C++: std::vector>>::reserve(unsigned long) --> void", pybind11::arg("__n")); + cl.def("__getitem__", (class std::vector > & (std::vector >>::*)(unsigned long)) &std::vector>>::operator[], "C++: std::vector>>::operator[](unsigned long) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (class std::vector > & (std::vector >>::*)(unsigned long)) &std::vector>>::at, "C++: std::vector>>::at(unsigned long) --> class std::vector > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (class std::vector > & (std::vector >>::*)()) &std::vector>>::front, "C++: std::vector>>::front() --> class std::vector > &", pybind11::return_value_policy::automatic); + cl.def("back", (class std::vector > & (std::vector >>::*)()) &std::vector>>::back, "C++: std::vector>>::back() --> class std::vector > &", pybind11::return_value_policy::automatic); + cl.def("data", (class std::vector > * (std::vector >>::*)()) &std::vector>>::data, "C++: std::vector>>::data() --> class std::vector > *", pybind11::return_value_policy::automatic); + cl.def("push_back", (void (std::vector >>::*)(const class std::vector > &)) &std::vector>>::push_back, "C++: std::vector>>::push_back(const class std::vector > &) --> void", pybind11::arg("__x")); + cl.def("pop_back", (void (std::vector >>::*)()) &std::vector>>::pop_back, "C++: std::vector>>::pop_back() --> void"); + cl.def("insert", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, const class std::vector > &)) &std::vector>>::insert, "C++: std::vector>>::insert(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, const class std::vector > &) --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >", pybind11::arg("__position"), pybind11::arg("__x")); + cl.def("insert", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, unsigned long, const class std::vector > &)) &std::vector>>::insert, "C++: std::vector>>::insert(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, unsigned long, const class std::vector > &) --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >", pybind11::arg("__position"), pybind11::arg("__n"), pybind11::arg("__x")); + cl.def("erase", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector > > >)) &std::vector>>::erase, "C++: std::vector>>::erase(class __gnu_cxx::__normal_iterator > *, class std::vector > > >) --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >", pybind11::arg("__position")); + cl.def("erase", (class __gnu_cxx::__normal_iterator > *, class std::vector > > > (std::vector >>::*)(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, class __gnu_cxx::__normal_iterator > *, class std::vector > > >)) &std::vector>>::erase, "C++: std::vector>>::erase(class __gnu_cxx::__normal_iterator > *, class std::vector > > >, class __gnu_cxx::__normal_iterator > *, class std::vector > > >) --> class __gnu_cxx::__normal_iterator > *, class std::vector > > >", pybind11::arg("__first"), pybind11::arg("__last")); + cl.def("swap", (void (std::vector >>::*)(class std::vector > > &)) &std::vector>>::swap, "C++: std::vector>>::swap(class std::vector > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::vector >>::*)()) &std::vector>>::clear, "C++: std::vector>>::clear() --> void"); } } @@ -302,45 +288,45 @@ void bind_std_stl_vector(std::function< pybind11::module &(std::string const &na #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_std_stl_vector_1(std::function< pybind11::module &(std::string const &namespace_) > &M) { { // std::vector file:bits/stl_vector.h line: - pybind11::class_>>>, std::shared_ptr>>>>> cl(M("std"), "vector_std_list_std_forward_list_std_deque_double_t", ""); - cl.def( pybind11::init( [](){ return new std::vector>>>(); } ) ); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > &>(), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](unsigned long const & a0){ return new std::vector>>>(a0); } ), "doc" , pybind11::arg("__n")); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::vector>>> const &o){ return new std::vector>>>(o); } ) ); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); - - cl.def("assign", (class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > & (std::vector>>>::*)(const class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &)) &std::vector>>>::operator=, "C++: std::vector>>>::operator=(const class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &) --> class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("begin", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)()) &std::vector>>>::begin, "C++: std::vector>>>::begin() --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("end", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)()) &std::vector>>>::end, "C++: std::vector>>>::end() --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("cbegin", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)() const) &std::vector>>>::cbegin, "C++: std::vector>>>::cbegin() const --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("cend", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)() const) &std::vector>>>::cend, "C++: std::vector>>>::cend() const --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("size", (unsigned long (std::vector>>>::*)() const) &std::vector>>>::size, "C++: std::vector>>>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::vector>>>::*)() const) &std::vector>>>::max_size, "C++: std::vector>>>::max_size() const --> unsigned long"); - cl.def("resize", (void (std::vector>>>::*)(unsigned long)) &std::vector>>>::resize, "C++: std::vector>>>::resize(unsigned long) --> void", pybind11::arg("__new_size")); - cl.def("shrink_to_fit", (void (std::vector>>>::*)()) &std::vector>>>::shrink_to_fit, "C++: std::vector>>>::shrink_to_fit() --> void"); - cl.def("capacity", (unsigned long (std::vector>>>::*)() const) &std::vector>>>::capacity, "C++: std::vector>>>::capacity() const --> unsigned long"); - cl.def("empty", (bool (std::vector>>>::*)() const) &std::vector>>>::empty, "C++: std::vector>>>::empty() const --> bool"); - cl.def("reserve", (void (std::vector>>>::*)(unsigned long)) &std::vector>>>::reserve, "C++: std::vector>>>::reserve(unsigned long) --> void", pybind11::arg("__n")); - cl.def("__getitem__", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::vector>>>::*)(unsigned long)) &std::vector>>>::operator[], "C++: std::vector>>>::operator[](unsigned long) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("at", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::vector>>>::*)(unsigned long)) &std::vector>>>::at, "C++: std::vector>>>::at(unsigned long) --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); - cl.def("front", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::vector>>>::*)()) &std::vector>>>::front, "C++: std::vector>>>::front() --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic); - cl.def("back", (class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > & (std::vector>>>::*)()) &std::vector>>>::back, "C++: std::vector>>>::back() --> class std::list >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > &", pybind11::return_value_policy::automatic); - cl.def("pop_back", (void (std::vector>>>::*)()) &std::vector>>>::pop_back, "C++: std::vector>>>::pop_back() --> void"); - cl.def("erase", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >)) &std::vector>>>::erase, "C++: std::vector>>>::erase(class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >) --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >", pybind11::arg("__position")); - cl.def("erase", (class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::vector>>>::*)(class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >)) &std::vector>>>::erase, "C++: std::vector>>>::erase(class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >) --> class __gnu_cxx::__normal_iterator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > *, class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >", pybind11::arg("__first"), pybind11::arg("__last")); - cl.def("swap", (void (std::vector>>>::*)(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &)) &std::vector>>>::swap, "C++: std::vector>>>::swap(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::vector>>>::*)()) &std::vector>>>::clear, "C++: std::vector>>>::clear() --> void"); + pybind11::class_ > >>, std::shared_ptr > >>>> cl(M("std"), "vector_std_list_std_forward_list_std_deque_double_t", ""); + cl.def( pybind11::init( [](){ return new std::vector > >>(); } ) ); + cl.def( pybind11::init > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](unsigned long const & a0){ return new std::vector > >>(a0); } ), "doc" , pybind11::arg("__n")); + cl.def( pybind11::init > > > &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::vector > >> const &o){ return new std::vector > >>(o); } ) ); + cl.def( pybind11::init > > > &, const class std::allocator > > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::vector > > > & (std::vector > >>::*)(const class std::vector > > > &)) &std::vector>>>::operator=, "C++: std::vector>>>::operator=(const class std::vector > > > &) --> class std::vector > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def("begin", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)()) &std::vector>>>::begin, "C++: std::vector>>>::begin() --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >"); + cl.def("end", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)()) &std::vector>>>::end, "C++: std::vector>>>::end() --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >"); + cl.def("cbegin", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)() const) &std::vector>>>::cbegin, "C++: std::vector>>>::cbegin() const --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >"); + cl.def("cend", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)() const) &std::vector>>>::cend, "C++: std::vector>>>::cend() const --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >"); + cl.def("size", (unsigned long (std::vector > >>::*)() const) &std::vector>>>::size, "C++: std::vector>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::vector > >>::*)() const) &std::vector>>>::max_size, "C++: std::vector>>>::max_size() const --> unsigned long"); + cl.def("resize", (void (std::vector > >>::*)(unsigned long)) &std::vector>>>::resize, "C++: std::vector>>>::resize(unsigned long) --> void", pybind11::arg("__new_size")); + cl.def("shrink_to_fit", (void (std::vector > >>::*)()) &std::vector>>>::shrink_to_fit, "C++: std::vector>>>::shrink_to_fit() --> void"); + cl.def("capacity", (unsigned long (std::vector > >>::*)() const) &std::vector>>>::capacity, "C++: std::vector>>>::capacity() const --> unsigned long"); + cl.def("empty", (bool (std::vector > >>::*)() const) &std::vector>>>::empty, "C++: std::vector>>>::empty() const --> bool"); + cl.def("reserve", (void (std::vector > >>::*)(unsigned long)) &std::vector>>>::reserve, "C++: std::vector>>>::reserve(unsigned long) --> void", pybind11::arg("__n")); + cl.def("__getitem__", (class std::list > > & (std::vector > >>::*)(unsigned long)) &std::vector>>>::operator[], "C++: std::vector>>>::operator[](unsigned long) --> class std::list > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("at", (class std::list > > & (std::vector > >>::*)(unsigned long)) &std::vector>>>::at, "C++: std::vector>>>::at(unsigned long) --> class std::list > > &", pybind11::return_value_policy::automatic, pybind11::arg("__n")); + cl.def("front", (class std::list > > & (std::vector > >>::*)()) &std::vector>>>::front, "C++: std::vector>>>::front() --> class std::list > > &", pybind11::return_value_policy::automatic); + cl.def("back", (class std::list > > & (std::vector > >>::*)()) &std::vector>>>::back, "C++: std::vector>>>::back() --> class std::list > > &", pybind11::return_value_policy::automatic); + cl.def("pop_back", (void (std::vector > >>::*)()) &std::vector>>>::pop_back, "C++: std::vector>>>::pop_back() --> void"); + cl.def("erase", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)(class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >)) &std::vector>>>::erase, "C++: std::vector>>>::erase(class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >) --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >", pybind11::arg("__position")); + cl.def("erase", (class __gnu_cxx::__normal_iterator > > *, class std::vector > > > > (std::vector > >>::*)(class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >, class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >)) &std::vector>>>::erase, "C++: std::vector>>>::erase(class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >, class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >) --> class __gnu_cxx::__normal_iterator > > *, class std::vector > > > >", pybind11::arg("__first"), pybind11::arg("__last")); + cl.def("swap", (void (std::vector > >>::*)(class std::vector > > > &)) &std::vector>>>::swap, "C++: std::vector>>>::swap(class std::vector > > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::vector > >>::*)()) &std::vector>>>::clear, "C++: std::vector>>>::clear() --> void"); } } @@ -360,33 +346,33 @@ void bind_std_stl_vector_1(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::list >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::list >)) &foo, "C++: foo(class std::list >) --> void", pybind11::arg("")); + // foo(class std::list) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::list)) &foo, "C++: foo(class std::list) --> void", pybind11::arg("")); - // foo(class std::forward_list >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::forward_list >)) &foo, "C++: foo(class std::forward_list >) --> void", pybind11::arg("")); + // foo(class std::forward_list) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::forward_list)) &foo, "C++: foo(class std::forward_list) --> void", pybind11::arg("")); - // foo(class std::vector >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::vector >)) &foo, "C++: foo(class std::vector >) --> void", pybind11::arg("")); + // foo(class std::vector) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::vector)) &foo, "C++: foo(class std::vector) --> void", pybind11::arg("")); - // foo(class std::deque >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::deque >)) &foo, "C++: foo(class std::deque >) --> void", pybind11::arg("")); + // foo(class std::deque) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::deque)) &foo, "C++: foo(class std::deque) --> void", pybind11::arg("")); - // foo(class std::vector >, class std::allocator > > >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::vector >, class std::allocator > > >)) &foo, "C++: foo(class std::vector >, class std::allocator > > >) --> void", pybind11::arg("")); + // foo(class std::vector >) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::vector >)) &foo, "C++: foo(class std::vector >) --> void", pybind11::arg("")); - // foo(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >)) &foo, "C++: foo(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >) --> void", pybind11::arg("")); + // foo(class std::vector > >) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::vector > >)) &foo, "C++: foo(class std::vector > >) --> void", pybind11::arg("")); - // foo(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >) file:T42.stl.names.hpp line: - M("").def("foo", (void (*)(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >)) &foo, "C++: foo(class std::vector >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::vector > > >) file:T42.stl.names.hpp line: + M("").def("foo", (void (*)(class std::vector > > >)) &foo, "C++: foo(class std::vector > > >) --> void", pybind11::arg("")); } @@ -400,10 +386,9 @@ void bind_T42_stl_names(std::function< pybind11::module &(std::string const &nam #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_deque(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_forward_list(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_std_stl_vector(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_std_stl_vector_1(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T42_stl_names(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -426,19 +411,18 @@ PYBIND11_MODULE(T42_stl_names, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); bind_std_stl_deque(M); - bind_std_forward_list(M); bind_std_stl_vector(M); bind_std_stl_vector_1(M); bind_T42_stl_names(M); @@ -448,7 +432,6 @@ PYBIND11_MODULE(T42_stl_names, root_module) { // Source list file: TEST/T42_stl_names.sources // T42_stl_names.cpp // std/stl_deque.cpp -// std/forward_list.cpp // std/stl_vector.cpp // std/stl_vector_1.cpp // T42_stl_names.cpp diff --git a/test/T42.stl.names.set.ref.cpp b/test/T42.stl.names.set.ref.cpp index e2fa91ec..001cbb4d 100644 --- a/test/T42.stl.names.set.ref.cpp +++ b/test/T42.stl.names.set.ref.cpp @@ -1,6 +1,7 @@ // File: std/stl_function.cpp #include // std::binary_function #include // std::equal_to +#include // std::hash #include // __str__ #include @@ -9,8 +10,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -25,15 +26,23 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & { // std::equal_to file:bits/stl_function.h line: pybind11::class_, std::shared_ptr>, std::binary_function> cl(M("std"), "equal_to_float_t", ""); cl.def( pybind11::init( [](){ return new std::equal_to(); } ) ); + cl.def( pybind11::init( [](std::equal_to const &o){ return new std::equal_to(o); } ) ); cl.def("__call__", (bool (std::equal_to::*)(const float &, const float &) const) &std::equal_to::operator(), "C++: std::equal_to::operator()(const float &, const float &) const --> bool", pybind11::arg("__x"), pybind11::arg("__y")); cl.def("assign", (struct std::binary_function & (std::binary_function::*)(const struct std::binary_function &)) &std::binary_function::operator=, "C++: std::binary_function::operator=(const struct std::binary_function &) --> struct std::binary_function &", pybind11::return_value_policy::automatic, pybind11::arg("")); } + { // std::hash file:bits/functional_hash.h line: + pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_float_t", ""); + cl.def( pybind11::init( [](){ return new std::hash(); } ) ); + cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); + cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); + } } -// File: std/functional_hash.cpp +// File: std/stl_set.cpp #include // std::deque #include // std::forward_list +#include // std::equal_to #include // std::hash #include // std::less #include // std::list @@ -41,6 +50,9 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #include // std::allocator #include // std::set #include // __str__ +#include // std::__detail::_Node_const_iterator +#include // std::__detail::_Node_iterator +#include // std::unordered_set #include // std::pair #include // std::vector @@ -50,20 +62,13 @@ void bind_std_stl_function(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M) +void bind_std_stl_set(std::function< pybind11::module &(std::string const &namespace_) > &M) { - { // std::hash file:bits/functional_hash.h line: - pybind11::class_, std::shared_ptr>> cl(M("std"), "hash_float_t", ""); - cl.def( pybind11::init( [](){ return new std::hash(); } ) ); - cl.def( pybind11::init( [](std::hash const &o){ return new std::hash(o); } ) ); - cl.def("__call__", (std::size_t (std::hash::*)(float) const) &std::hash::operator(), "C++: std::hash::operator()(float) const --> std::size_t", pybind11::arg("__val")); - cl.def("assign", (struct std::hash & (std::hash::*)(const struct std::hash &)) &std::hash::operator=, "C++: std::hash::operator=(const struct std::hash &) --> struct std::hash &", pybind11::return_value_policy::automatic, pybind11::arg("")); - } { // std::set file:bits/stl_set.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "set_float_t", ""); cl.def( pybind11::init( [](){ return new std::set(); } ) ); @@ -71,14 +76,18 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::set const &o){ return new std::set(o); } ) ); - cl.def("assign", (class std::set, class std::allocator > & (std::set::*)(const class std::set, class std::allocator > &)) &std::set::operator=, "C++: std::set::operator=(const class std::set, class std::allocator > &) --> class std::set, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::set & (std::set::*)(const class std::set &)) &std::set::operator=, "C++: std::set::operator=(const class std::set &) --> class std::set &", pybind11::return_value_policy::automatic, pybind11::arg("")); cl.def("key_comp", (struct std::less (std::set::*)() const) &std::set::key_comp, "C++: std::set::key_comp() const --> struct std::less"); cl.def("value_comp", (struct std::less (std::set::*)() const) &std::set::value_comp, "C++: std::set::value_comp() const --> struct std::less"); cl.def("get_allocator", (class std::allocator (std::set::*)() const) &std::set::get_allocator, "C++: std::set::get_allocator() const --> class std::allocator"); cl.def("empty", (bool (std::set::*)() const) &std::set::empty, "C++: std::set::empty() const --> bool"); cl.def("size", (unsigned long (std::set::*)() const) &std::set::size, "C++: std::set::size() const --> unsigned long"); cl.def("max_size", (unsigned long (std::set::*)() const) &std::set::max_size, "C++: std::set::max_size() const --> unsigned long"); - cl.def("swap", (void (std::set::*)(class std::set, class std::allocator > &)) &std::set::swap, "C++: std::set::swap(class std::set, class std::allocator > &) --> void", pybind11::arg("__x")); + cl.def("swap", (void (std::set::*)(class std::set &)) &std::set::swap, "C++: std::set::swap(class std::set &) --> void", pybind11::arg("__x")); cl.def("insert", (struct std::pair, bool> (std::set::*)(const float &)) &std::set::insert, "C++: std::set::insert(const float &) --> struct std::pair, bool>", pybind11::arg("__x")); cl.def("erase", (unsigned long (std::set::*)(const float &)) &std::set::erase, "C++: std::set::erase(const float &) --> unsigned long", pybind11::arg("__x")); cl.def("clear", (void (std::set::*)()) &std::set::clear, "C++: std::set::clear() --> void"); @@ -86,79 +95,65 @@ void bind_std_functional_hash(std::function< pybind11::module &(std::string cons cl.def("equal_range", (struct std::pair, struct std::_Rb_tree_const_iterator > (std::set::*)(const float &)) &std::set::equal_range, "C++: std::set::equal_range(const float &) --> struct std::pair, struct std::_Rb_tree_const_iterator >", pybind11::arg("__x")); } { // std::set file:bits/stl_set.h line: - pybind11::class_>>>>, std::shared_ptr>>>>>> cl(M("std"), "set_std_list_std_forward_list_std_deque_std_vector_double_t", ""); - cl.def( pybind11::init( [](){ return new std::set>>>>(); } ) ); - cl.def( pybind11::init( [](const struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > & a0){ return new std::set>>>>(a0); } ), "doc" , pybind11::arg("__comp")); - cl.def( pybind11::init >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &, const class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); - - cl.def( pybind11::init( [](std::set>>>> const &o){ return new std::set>>>>(o); } ) ); - cl.def("assign", (class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > & (std::set>>>>::*)(const class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &)) &std::set>>>>::operator=, "C++: std::set>>>>::operator=(const class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &) --> class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("__x")); - cl.def("key_comp", (struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::set>>>>::*)() const) &std::set>>>>::key_comp, "C++: std::set>>>>::key_comp() const --> struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("value_comp", (struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::set>>>>::*)() const) &std::set>>>>::value_comp, "C++: std::set>>>>::value_comp() const --> struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("get_allocator", (class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > (std::set>>>>::*)() const) &std::set>>>>::get_allocator, "C++: std::set>>>>::get_allocator() const --> class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >"); - cl.def("empty", (bool (std::set>>>>::*)() const) &std::set>>>>::empty, "C++: std::set>>>>::empty() const --> bool"); - cl.def("size", (unsigned long (std::set>>>>::*)() const) &std::set>>>>::size, "C++: std::set>>>>::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::set>>>>::*)() const) &std::set>>>>::max_size, "C++: std::set>>>>::max_size() const --> unsigned long"); - cl.def("swap", (void (std::set>>>>::*)(class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &)) &std::set>>>>::swap, "C++: std::set>>>>::swap(class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > > &) --> void", pybind11::arg("__x")); - cl.def("clear", (void (std::set>>>>::*)()) &std::set>>>>::clear, "C++: std::set>>>>::clear() --> void"); + pybind11::class_ > > >>, std::shared_ptr > > >>>> cl(M("std"), "set_std_list_std_forward_list_std_deque_std_vector_double_t", ""); + cl.def( pybind11::init( [](){ return new std::set > > >>(); } ) ); + cl.def( pybind11::init( [](const struct std::less > > > > & a0){ return new std::set > > >>(a0); } ), "doc" , pybind11::arg("__comp")); + cl.def( pybind11::init > > > > &, const class std::allocator > > > > &>(), pybind11::arg("__comp"), pybind11::arg("__a") ); + + cl.def( pybind11::init( [](std::set > > >> const &o){ return new std::set > > >>(o); } ) ); + cl.def( pybind11::init > > > > &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init > > > > &, const class std::allocator > > > > &>(), pybind11::arg("__x"), pybind11::arg("__a") ); + + cl.def("assign", (class std::set > > > > & (std::set > > >>::*)(const class std::set > > > > &)) &std::set>>>>::operator=, "C++: std::set>>>>::operator=(const class std::set > > > > &) --> class std::set > > > > &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("key_comp", (struct std::less > > > > (std::set > > >>::*)() const) &std::set>>>>::key_comp, "C++: std::set>>>>::key_comp() const --> struct std::less > > > >"); + cl.def("value_comp", (struct std::less > > > > (std::set > > >>::*)() const) &std::set>>>>::value_comp, "C++: std::set>>>>::value_comp() const --> struct std::less > > > >"); + cl.def("get_allocator", (class std::allocator > > > > (std::set > > >>::*)() const) &std::set>>>>::get_allocator, "C++: std::set>>>>::get_allocator() const --> class std::allocator > > > >"); + cl.def("empty", (bool (std::set > > >>::*)() const) &std::set>>>>::empty, "C++: std::set>>>>::empty() const --> bool"); + cl.def("size", (unsigned long (std::set > > >>::*)() const) &std::set>>>>::size, "C++: std::set>>>>::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::set > > >>::*)() const) &std::set>>>>::max_size, "C++: std::set>>>>::max_size() const --> unsigned long"); + cl.def("swap", (void (std::set > > >>::*)(class std::set > > > > &)) &std::set>>>>::swap, "C++: std::set>>>>::swap(class std::set > > > > &) --> void", pybind11::arg("__x")); + cl.def("clear", (void (std::set > > >>::*)()) &std::set>>>>::clear, "C++: std::set>>>>::clear() --> void"); } -} - - -// File: std/unordered_set.cpp -#include // std::equal_to -#include // std::hash -#include // std::allocator -#include // __str__ -#include // std::__detail::_Node_const_iterator -#include // std::__detail::_Node_iterator -#include // std::unordered_set -#include // std::pair - -#include -#include -#include - -#ifndef BINDER_PYBIND11_TYPE_CASTER - #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) - PYBIND11_MAKE_OPAQUE(std::shared_ptr) -#endif - -void bind_std_unordered_set(std::function< pybind11::module &(std::string const &namespace_) > &M) -{ { // std::unordered_set file:bits/unordered_set.h line: pybind11::class_, std::shared_ptr>> cl(M("std"), "unordered_set_float_t", ""); - cl.def( pybind11::init( [](){ return new std::unordered_set(); } ), "doc" ); + cl.def( pybind11::init( [](){ return new std::unordered_set(); } ) ); cl.def( pybind11::init( [](unsigned long const & a0){ return new std::unordered_set(a0); } ), "doc" , pybind11::arg("__n")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1){ return new std::unordered_set(a0, a1); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf")); cl.def( pybind11::init( [](unsigned long const & a0, const struct std::hash & a1, const struct std::equal_to & a2){ return new std::unordered_set(a0, a1, a2); } ), "doc" , pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql")); cl.def( pybind11::init &, const struct std::equal_to &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__eql"), pybind11::arg("__a") ); cl.def( pybind11::init( [](std::unordered_set const &o){ return new std::unordered_set(o); } ) ); - cl.def("assign", (class std::unordered_set, struct std::equal_to, class std::allocator > & (std::unordered_set::*)(const class std::unordered_set, struct std::equal_to, class std::allocator > &)) &std::unordered_set, std::equal_to, std::allocator >::operator=, "C++: std::unordered_set, std::equal_to, std::allocator >::operator=(const class std::unordered_set, struct std::equal_to, class std::allocator > &) --> class std::unordered_set, struct std::equal_to, class std::allocator > &", pybind11::return_value_policy::automatic, pybind11::arg("")); - cl.def("get_allocator", (class std::allocator (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::get_allocator, "C++: std::unordered_set, std::equal_to, std::allocator >::get_allocator() const --> class std::allocator"); - cl.def("empty", (bool (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::empty, "C++: std::unordered_set, std::equal_to, std::allocator >::empty() const --> bool"); - cl.def("size", (unsigned long (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::size, "C++: std::unordered_set, std::equal_to, std::allocator >::size() const --> unsigned long"); - cl.def("max_size", (unsigned long (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::max_size, "C++: std::unordered_set, std::equal_to, std::allocator >::max_size() const --> unsigned long"); - cl.def("insert", (struct std::pair, bool> (std::unordered_set::*)(const float &)) &std::unordered_set, std::equal_to, std::allocator >::insert, "C++: std::unordered_set, std::equal_to, std::allocator >::insert(const float &) --> struct std::pair, bool>", pybind11::arg("__x")); - cl.def("erase", (unsigned long (std::unordered_set::*)(const float &)) &std::unordered_set, std::equal_to, std::allocator >::erase, "C++: std::unordered_set, std::equal_to, std::allocator >::erase(const float &) --> unsigned long", pybind11::arg("__x")); - cl.def("clear", (void (std::unordered_set::*)()) &std::unordered_set, std::equal_to, std::allocator >::clear, "C++: std::unordered_set, std::equal_to, std::allocator >::clear() --> void"); - cl.def("swap", (void (std::unordered_set::*)(class std::unordered_set, struct std::equal_to, class std::allocator > &)) &std::unordered_set, std::equal_to, std::allocator >::swap, "C++: std::unordered_set, std::equal_to, std::allocator >::swap(class std::unordered_set, struct std::equal_to, class std::allocator > &) --> void", pybind11::arg("__x")); - cl.def("hash_function", (struct std::hash (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::hash_function, "C++: std::unordered_set, std::equal_to, std::allocator >::hash_function() const --> struct std::hash"); - cl.def("key_eq", (struct std::equal_to (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::key_eq, "C++: std::unordered_set, std::equal_to, std::allocator >::key_eq() const --> struct std::equal_to"); - cl.def("count", (unsigned long (std::unordered_set::*)(const float &) const) &std::unordered_set, std::equal_to, std::allocator >::count, "C++: std::unordered_set, std::equal_to, std::allocator >::count(const float &) const --> unsigned long", pybind11::arg("__x")); - cl.def("equal_range", (struct std::pair, struct std::__detail::_Node_iterator > (std::unordered_set::*)(const float &)) &std::unordered_set, std::equal_to, std::allocator >::equal_range, "C++: std::unordered_set, std::equal_to, std::allocator >::equal_range(const float &) --> struct std::pair, struct std::__detail::_Node_iterator >", pybind11::arg("__x")); - cl.def("bucket_count", (unsigned long (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::bucket_count, "C++: std::unordered_set, std::equal_to, std::allocator >::bucket_count() const --> unsigned long"); - cl.def("max_bucket_count", (unsigned long (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::max_bucket_count, "C++: std::unordered_set, std::equal_to, std::allocator >::max_bucket_count() const --> unsigned long"); - cl.def("bucket_size", (unsigned long (std::unordered_set::*)(unsigned long) const) &std::unordered_set, std::equal_to, std::allocator >::bucket_size, "C++: std::unordered_set, std::equal_to, std::allocator >::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); - cl.def("bucket", (unsigned long (std::unordered_set::*)(const float &) const) &std::unordered_set, std::equal_to, std::allocator >::bucket, "C++: std::unordered_set, std::equal_to, std::allocator >::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); - cl.def("load_factor", (float (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::load_factor, "C++: std::unordered_set, std::equal_to, std::allocator >::load_factor() const --> float"); - cl.def("max_load_factor", (float (std::unordered_set::*)() const) &std::unordered_set, std::equal_to, std::allocator >::max_load_factor, "C++: std::unordered_set, std::equal_to, std::allocator >::max_load_factor() const --> float"); - cl.def("max_load_factor", (void (std::unordered_set::*)(float)) &std::unordered_set, std::equal_to, std::allocator >::max_load_factor, "C++: std::unordered_set, std::equal_to, std::allocator >::max_load_factor(float) --> void", pybind11::arg("__z")); - cl.def("rehash", (void (std::unordered_set::*)(unsigned long)) &std::unordered_set, std::equal_to, std::allocator >::rehash, "C++: std::unordered_set, std::equal_to, std::allocator >::rehash(unsigned long) --> void", pybind11::arg("__n")); - cl.def("reserve", (void (std::unordered_set::*)(unsigned long)) &std::unordered_set, std::equal_to, std::allocator >::reserve, "C++: std::unordered_set, std::equal_to, std::allocator >::reserve(unsigned long) --> void", pybind11::arg("__n")); + cl.def( pybind11::init &>(), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__uset"), pybind11::arg("__a") ); + + cl.def( pybind11::init &>(), pybind11::arg("__n"), pybind11::arg("__a") ); + + cl.def( pybind11::init &, const class std::allocator &>(), pybind11::arg("__n"), pybind11::arg("__hf"), pybind11::arg("__a") ); + + cl.def("assign", (class std::unordered_set & (std::unordered_set::*)(const class std::unordered_set &)) &std::unordered_set::operator=, "C++: std::unordered_set::operator=(const class std::unordered_set &) --> class std::unordered_set &", pybind11::return_value_policy::automatic, pybind11::arg("")); + cl.def("get_allocator", (class std::allocator (std::unordered_set::*)() const) &std::unordered_set::get_allocator, "C++: std::unordered_set::get_allocator() const --> class std::allocator"); + cl.def("empty", (bool (std::unordered_set::*)() const) &std::unordered_set::empty, "C++: std::unordered_set::empty() const --> bool"); + cl.def("size", (unsigned long (std::unordered_set::*)() const) &std::unordered_set::size, "C++: std::unordered_set::size() const --> unsigned long"); + cl.def("max_size", (unsigned long (std::unordered_set::*)() const) &std::unordered_set::max_size, "C++: std::unordered_set::max_size() const --> unsigned long"); + cl.def("insert", (struct std::pair, bool> (std::unordered_set::*)(const float &)) &std::unordered_set::insert, "C++: std::unordered_set::insert(const float &) --> struct std::pair, bool>", pybind11::arg("__x")); + cl.def("erase", (unsigned long (std::unordered_set::*)(const float &)) &std::unordered_set::erase, "C++: std::unordered_set::erase(const float &) --> unsigned long", pybind11::arg("__x")); + cl.def("clear", (void (std::unordered_set::*)()) &std::unordered_set::clear, "C++: std::unordered_set::clear() --> void"); + cl.def("swap", (void (std::unordered_set::*)(class std::unordered_set &)) &std::unordered_set::swap, "C++: std::unordered_set::swap(class std::unordered_set &) --> void", pybind11::arg("__x")); + cl.def("hash_function", (struct std::hash (std::unordered_set::*)() const) &std::unordered_set::hash_function, "C++: std::unordered_set::hash_function() const --> struct std::hash"); + cl.def("key_eq", (struct std::equal_to (std::unordered_set::*)() const) &std::unordered_set::key_eq, "C++: std::unordered_set::key_eq() const --> struct std::equal_to"); + cl.def("count", (unsigned long (std::unordered_set::*)(const float &) const) &std::unordered_set::count, "C++: std::unordered_set::count(const float &) const --> unsigned long", pybind11::arg("__x")); + cl.def("equal_range", (struct std::pair, struct std::__detail::_Node_iterator > (std::unordered_set::*)(const float &)) &std::unordered_set::equal_range, "C++: std::unordered_set::equal_range(const float &) --> struct std::pair, struct std::__detail::_Node_iterator >", pybind11::arg("__x")); + cl.def("bucket_count", (unsigned long (std::unordered_set::*)() const) &std::unordered_set::bucket_count, "C++: std::unordered_set::bucket_count() const --> unsigned long"); + cl.def("max_bucket_count", (unsigned long (std::unordered_set::*)() const) &std::unordered_set::max_bucket_count, "C++: std::unordered_set::max_bucket_count() const --> unsigned long"); + cl.def("bucket_size", (unsigned long (std::unordered_set::*)(unsigned long) const) &std::unordered_set::bucket_size, "C++: std::unordered_set::bucket_size(unsigned long) const --> unsigned long", pybind11::arg("__n")); + cl.def("bucket", (unsigned long (std::unordered_set::*)(const float &) const) &std::unordered_set::bucket, "C++: std::unordered_set::bucket(const float &) const --> unsigned long", pybind11::arg("__key")); + cl.def("load_factor", (float (std::unordered_set::*)() const) &std::unordered_set::load_factor, "C++: std::unordered_set::load_factor() const --> float"); + cl.def("max_load_factor", (float (std::unordered_set::*)() const) &std::unordered_set::max_load_factor, "C++: std::unordered_set::max_load_factor() const --> float"); + cl.def("max_load_factor", (void (std::unordered_set::*)(float)) &std::unordered_set::max_load_factor, "C++: std::unordered_set::max_load_factor(float) --> void", pybind11::arg("__z")); + cl.def("rehash", (void (std::unordered_set::*)(unsigned long)) &std::unordered_set::rehash, "C++: std::unordered_set::rehash(unsigned long) --> void", pybind11::arg("__n")); + cl.def("reserve", (void (std::unordered_set::*)(unsigned long)) &std::unordered_set::reserve, "C++: std::unordered_set::reserve(unsigned long) --> void", pybind11::arg("__n")); } } @@ -186,21 +181,21 @@ void bind_std_unordered_set(std::function< pybind11::module &(std::string const #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T42_stl_names_set(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // foo(class std::set, class std::allocator >) file:T42.stl.names.set.hpp line: - M("").def("foo", (void (*)(class std::set, class std::allocator >)) &foo, "C++: foo(class std::set, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::set) file:T42.stl.names.set.hpp line: + M("").def("foo", (void (*)(class std::set)) &foo, "C++: foo(class std::set) --> void", pybind11::arg("")); - // foo(class std::unordered_set, struct std::equal_to, class std::allocator >) file:T42.stl.names.set.hpp line: - M("").def("foo", (void (*)(class std::unordered_set, struct std::equal_to, class std::allocator >)) &foo, "C++: foo(class std::unordered_set, struct std::equal_to, class std::allocator >) --> void", pybind11::arg("")); + // foo(class std::unordered_set) file:T42.stl.names.set.hpp line: + M("").def("foo", (void (*)(class std::unordered_set)) &foo, "C++: foo(class std::unordered_set) --> void", pybind11::arg("")); - // foo(class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >) file:T42.stl.names.set.hpp line: - M("").def("foo", (void (*)(class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >)) &foo, "C++: foo(class std::set >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > >, struct std::less >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > >, class std::allocator >, class std::allocator > > >, class std::allocator >, class std::allocator > > > > > > > > >) --> void", pybind11::arg("")); + // foo(class std::set > > > >) file:T42.stl.names.set.hpp line: + M("").def("foo", (void (*)(class std::set > > > >)) &foo, "C++: foo(class std::set > > > >) --> void", pybind11::arg("")); } @@ -214,11 +209,10 @@ void bind_T42_stl_names_set(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_std_stl_function(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_functional_hash(std::function< pybind11::module &(std::string const &namespace_) > &M); -void bind_std_unordered_set(std::function< pybind11::module &(std::string const &namespace_) > &M); +void bind_std_stl_set(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T42_stl_names_set(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -239,20 +233,19 @@ PYBIND11_MODULE(T42_stl_names_set, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "std"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); bind_std_stl_function(M); - bind_std_functional_hash(M); - bind_std_unordered_set(M); + bind_std_stl_set(M); bind_T42_stl_names_set(M); } @@ -260,8 +253,7 @@ PYBIND11_MODULE(T42_stl_names_set, root_module) { // Source list file: TEST/T42_stl_names_set.sources // T42_stl_names_set.cpp // std/stl_function.cpp -// std/functional_hash.cpp -// std/unordered_set.cpp +// std/stl_set.cpp // T42_stl_names_set.cpp // Modules list file: TEST/T42_stl_names_set.modules diff --git a/test/T43.stl.pybind11_include_stl.ref.cpp b/test/T43.stl.pybind11_include_stl.ref.cpp index f0c911b2..b6fde588 100644 --- a/test/T43.stl.pybind11_include_stl.ref.cpp +++ b/test/T43.stl.pybind11_include_stl.ref.cpp @@ -27,15 +27,15 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif void bind_T43_stl_pybind11_include_stl(std::function< pybind11::module &(std::string const &namespace_) > &M) { - // test_include_stl(class std::vector >, class std::deque >, class std::list >, struct std::array, class std::valarray, class std::set, class std::allocator >, class std::unordered_set, struct std::equal_to, class std::allocator >, class std::map, class std::allocator > >, class std::unordered_map, struct std::equal_to, class std::allocator > >) file:T43.stl.pybind11_include_stl.hpp line: - M("").def("test_include_stl", (void (*)(class std::vector >, class std::deque >, class std::list >, struct std::array, class std::valarray, class std::set, class std::allocator >, class std::unordered_set, struct std::equal_to, class std::allocator >, class std::map, class std::allocator > >, class std::unordered_map, struct std::equal_to, class std::allocator > >)) &test_include_stl, "C++: test_include_stl(class std::vector >, class std::deque >, class std::list >, struct std::array, class std::valarray, class std::set, class std::allocator >, class std::unordered_set, struct std::equal_to, class std::allocator >, class std::map, class std::allocator > >, class std::unordered_map, struct std::equal_to, class std::allocator > >) --> void", pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg("")); + // test_include_stl(class std::vector, class std::deque, class std::list, struct std::array, class std::valarray, class std::set, class std::unordered_set, class std::map, class std::unordered_map) file:T43.stl.pybind11_include_stl.hpp line: + M("").def("test_include_stl", (void (*)(class std::vector, class std::deque, class std::list, struct std::array, class std::valarray, class std::set, class std::unordered_set, class std::map, class std::unordered_map)) &test_include_stl, "C++: test_include_stl(class std::vector, class std::deque, class std::list, struct std::array, class std::valarray, class std::set, class std::unordered_set, class std::map, class std::unordered_map) --> void", pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg(""), pybind11::arg("")); } @@ -49,7 +49,7 @@ void bind_T43_stl_pybind11_include_stl(std::function< pybind11::module &(std::st #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T43_stl_pybind11_include_stl(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -71,13 +71,13 @@ PYBIND11_MODULE(T43_stl_pybind11_include_stl, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T50.add_on_binder.ref.cpp b/test/T50.add_on_binder.ref.cpp index d0b0fb46..21b3f8fb 100644 --- a/test/T50.add_on_binder.ref.cpp +++ b/test/T50.add_on_binder.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -33,7 +33,7 @@ void bind_T50_add_on_binder(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T50_add_on_binder(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -55,13 +55,13 @@ PYBIND11_MODULE(T50_add_on_binder, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T50.namespace_binder.ref.cpp b/test/T50.namespace_binder.ref.cpp index 34b9219b..24cff295 100644 --- a/test/T50.namespace_binder.ref.cpp +++ b/test/T50.namespace_binder.ref.cpp @@ -7,8 +7,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -31,8 +31,8 @@ void bind_T50_namespace_binder(std::function< pybind11::module &(std::string con #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -55,8 +55,8 @@ void bind_T50_namespace_binder_1(std::function< pybind11::module &(std::string c #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -76,7 +76,7 @@ void bind_T50_namespace_binder_2(std::function< pybind11::module &(std::string c #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T50_namespace_binder(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T50_namespace_binder_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -100,7 +100,7 @@ PYBIND11_MODULE(T50_namespace_binder, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -108,7 +108,7 @@ PYBIND11_MODULE(T50_namespace_binder, root_module) { {"", "aaaa"}, {"aaaa", "bbbb"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T60.custom_shared.ref.cpp b/test/T60.custom_shared.ref.cpp index 2e0027ed..e32ce99c 100644 --- a/test/T60.custom_shared.ref.cpp +++ b/test/T60.custom_shared.ref.cpp @@ -11,8 +11,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, my_shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, my_shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(my_shared_ptr) #endif @@ -74,7 +74,7 @@ void bind_T60_custom_shared(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T60_custom_shared(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -96,13 +96,13 @@ PYBIND11_MODULE(T60_custom_shared, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T60.pybind11.ref.cpp b/test/T60.pybind11.ref.cpp index ccecc748..9d182215 100644 --- a/test/T60.pybind11.ref.cpp +++ b/test/T60.pybind11.ref.cpp @@ -2,10 +2,46 @@ #include // foo #include // __gnu_cxx::__normal_iterator #include // std::allocator +#include // pybind11::detail::function_record #include // pybind11::array #include // pybind11::dtype +#include // pybind11::bool_ +#include // pybind11::buffer +#include // pybind11::bytes +#include // pybind11::capsule +#include // pybind11::detail::accessor +#include // pybind11::detail::accessor_policies::generic_item +#include // pybind11::detail::accessor_policies::list_item +#include // pybind11::detail::accessor_policies::obj_attr +#include // pybind11::detail::accessor_policies::sequence_item +#include // pybind11::detail::accessor_policies::str_attr +#include // pybind11::detail::accessor_policies::tuple_item +#include // pybind11::detail::args_proxy +#include // pybind11::detail::generic_iterator +#include // pybind11::detail::iterator_policies::dict_readonly +#include // pybind11::detail::iterator_policies::sequence_fast_readonly +#include // pybind11::detail::iterator_policies::sequence_slow_readwrite +#include // pybind11::detail::object_api +#include // pybind11::dict +#include // pybind11::ellipsis +#include // pybind11::float_ +#include // pybind11::function +#include // pybind11::handle +#include // pybind11::int_ +#include // pybind11::iterable +#include // pybind11::iterator +#include // pybind11::list +#include // pybind11::none +#include // pybind11::object +#include // pybind11::sequence +#include // pybind11::set +#include // pybind11::slice +#include // pybind11::str +#include // pybind11::tuple +#include // pybind11::weakref #include // std::basic_string #include // std::char_traits +#include // std::type_info #include // std::pair #include // std::vector @@ -15,8 +51,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -103,7 +139,7 @@ void bind_T60_pybind11(std::function< pybind11::module &(std::string const &name #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T60_pybind11(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -125,13 +161,13 @@ PYBIND11_MODULE(T60_pybind11, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T70.module_local.ref.cpp b/test/T70.module_local.ref.cpp index 9b6252b3..0a08563a 100644 --- a/test/T70.module_local.ref.cpp +++ b/test/T70.module_local.ref.cpp @@ -8,8 +8,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -33,8 +33,8 @@ void bind_T70_module_local(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -57,7 +57,7 @@ void bind_T70_module_local_1(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T70_module_local(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T70_module_local_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -80,7 +80,7 @@ PYBIND11_MODULE(T70_module_local, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -88,7 +88,7 @@ PYBIND11_MODULE(T70_module_local, root_module) { {"", "aaa"}, {"", "bbb"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T70.options.ref.cpp b/test/T70.options.ref.cpp index 987f2eb8..fabb21a5 100644 --- a/test/T70.options.ref.cpp +++ b/test/T70.options.ref.cpp @@ -10,8 +10,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -48,8 +48,8 @@ void bind_T70_options(std::function< pybind11::module &(std::string const &names #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -76,8 +76,8 @@ void bind_T70_options_1(std::function< pybind11::module &(std::string const &nam #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -102,7 +102,7 @@ void bind_T70_options_2(std::function< pybind11::module &(std::string const &nam #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T70_options(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T70_options_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -126,7 +126,7 @@ PYBIND11_MODULE(T70_options, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -135,7 +135,7 @@ PYBIND11_MODULE(T70_options, root_module) { {"aaaa", "bbbb"}, {"aaaa", "cccc"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T71.module_local.ref.cpp b/test/T71.module_local.ref.cpp index 18b40727..d9f0f18c 100644 --- a/test/T71.module_local.ref.cpp +++ b/test/T71.module_local.ref.cpp @@ -9,8 +9,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -42,8 +42,8 @@ void bind_T71_module_local(std::function< pybind11::module &(std::string const & #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -66,7 +66,7 @@ void bind_T71_module_local_1(std::function< pybind11::module &(std::string const #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T71_module_local(std::function< pybind11::module &(std::string const &namespace_) > &M); void bind_T71_module_local_1(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -89,7 +89,7 @@ PYBIND11_MODULE(T71_module_local, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); @@ -97,7 +97,7 @@ PYBIND11_MODULE(T71_module_local, root_module) { {"", "aaa"}, {"", "bbb"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T80.custom_trampoline.ref.cpp b/test/T80.custom_trampoline.ref.cpp index 6ac45288..96cf96cb 100644 --- a/test/T80.custom_trampoline.ref.cpp +++ b/test/T80.custom_trampoline.ref.cpp @@ -9,8 +9,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -45,7 +45,7 @@ void bind_T80_custom_trampoline(std::function< pybind11::module &(std::string co #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T80_custom_trampoline(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -67,14 +67,14 @@ PYBIND11_MODULE(T80_custom_trampoline, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "aaa"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_"); diff --git a/test/T81.custom_trampoline_with_args.ref.cpp b/test/T81.custom_trampoline_with_args.ref.cpp index a2832b55..0a5d33c5 100644 --- a/test/T81.custom_trampoline_with_args.ref.cpp +++ b/test/T81.custom_trampoline_with_args.ref.cpp @@ -13,8 +13,8 @@ #ifndef BINDER_PYBIND11_TYPE_CASTER #define BINDER_PYBIND11_TYPE_CASTER - PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr) - PYBIND11_DECLARE_HOLDER_TYPE(T, T*) + PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr, false) + PYBIND11_DECLARE_HOLDER_TYPE(T, T*, false) PYBIND11_MAKE_OPAQUE(std::shared_ptr) #endif @@ -47,7 +47,7 @@ void bind_T81_custom_trampoline_with_args(std::function< pybind11::module &(std: #include -typedef std::function< pybind11::module & (std::string const &) > ModuleGetter; +using ModuleGetter = std::function< pybind11::module & (std::string const &) >; void bind_T81_custom_trampoline_with_args(std::function< pybind11::module &(std::string const &namespace_) > &M); @@ -69,14 +69,14 @@ PYBIND11_MODULE(T81_custom_trampoline_with_args, root_module) { auto mangle_namespace_name( [](std::string const &ns) -> std::string { if ( std::find(reserved_python_words.begin(), reserved_python_words.end(), ns) == reserved_python_words.end() ) return ns; - else return ns+'_'; + return ns+'_'; } ); std::vector< std::pair > sub_modules { {"", "aaa"}, }; - for(auto &p : sub_modules ) modules[p.first.size() ? p.first+"::"+p.second : p.second] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); + for(auto &p : sub_modules ) modules[ p.first.empty() ? p.second : p.first+"::"+p.second ] = modules[p.first].def_submodule( mangle_namespace_name(p.second).c_str(), ("Bindings for " + p.first + "::" + p.second + " namespace").c_str() ); //pybind11::class_>(M(""), "_encapsulated_data_");