File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
py-demo/bindings/src/modules Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,10 @@ install_pybind11() {
5959}
6060
6161install_demo () {
62- cmake -S " ${TESTS_ROOT} /demo-lib" -B " ${BUILD_ROOT} /demo"
62+ cmake \
63+ -S " ${TESTS_ROOT} /demo-lib" \
64+ -B " ${BUILD_ROOT} /demo" \
65+ -DCMAKE_CXX_STANDARD=17
6366 cmake --build " ${BUILD_ROOT} /demo"
6467 cmake --install " ${BUILD_ROOT} /demo" \
6568 --prefix " ${INSTALL_PREFIX} "
Original file line number Diff line number Diff line change 11#include " modules.h"
22
3- namespace mymodules {
3+ namespace {
44struct Dummy {
55 int regular_method (int x) { return x + 1 ; }
66 static int static_method (int x) { return x + 1 ; }
@@ -9,8 +9,8 @@ struct Dummy {
99} // namespace
1010
1111void bind_methods_module (py::module && m) {
12- auto &&pyDummy = py::class_<mymodules:: Dummy>(m, " Dummy" );
12+ auto &&pyDummy = py::class_<Dummy>(m, " Dummy" );
1313
14- pyDummy.def_static (" static_method" , &mymodules:: Dummy::static_method);
15- pyDummy.def (" regular_method" , &mymodules:: Dummy::regular_method);
14+ pyDummy.def_static (" static_method" , &Dummy::static_method);
15+ pyDummy.def (" regular_method" , &Dummy::regular_method);
1616}
Original file line number Diff line number Diff line change 44
55#include < chrono>
66
7- namespace myvalues {
7+ namespace {
88class Dummy {};
99class Foo {};
1010} // namespace
1111
1212void bind_values_module (py::module &&m) {
1313 {
1414 // python module as value
15- auto &&pyDummy = py::class_<myvalues:: Dummy>(m, " Dummy" );
15+ auto &&pyDummy = py::class_<Dummy>(m, " Dummy" );
1616
1717 pyDummy.def_property_readonly_static (
1818 " linalg" , [](py::object &) { return py::module::import (" numpy.linalg" ); });
@@ -27,12 +27,12 @@ void bind_values_module(py::module &&m) {
2727 m.attr (" list_with_none" ) = li;
2828 }
2929 {
30- auto pyFoo = py::class_<myvalues:: Foo>(m, " Foo" );
31- m.attr (" foovar" ) = myvalues:: Foo ();
30+ auto pyFoo = py::class_<Foo>(m, " Foo" );
31+ m.attr (" foovar" ) = Foo ();
3232
3333 py::list foolist;
34- foolist.append (myvalues:: Foo ());
35- foolist.append (myvalues:: Foo ());
34+ foolist.append (Foo ());
35+ foolist.append (Foo ());
3636
3737 m.attr (" foolist" ) = foolist;
3838 m.attr (" none" ) = py::none ();
You can’t perform that action at this time.
0 commit comments