mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Fix typos in Eigen documentation
Fixes one small variable name typo, and two instances where `py::arg().nocopy()` is used, where I think it should be `py::arg().noconvert()` instead. Probably `nocopy()` was the old/original name for it and then it was changed.
This commit is contained in:
parent
5e14aa6aa7
commit
d265933d85
@ -57,7 +57,7 @@ expected:
|
|||||||
|
|
||||||
.. code-block:: cpp
|
.. code-block:: cpp
|
||||||
|
|
||||||
void scale_by_2(Eigen::Ref<Eigen::VectorXd> m) {
|
void scale_by_2(Eigen::Ref<Eigen::VectorXd> v) {
|
||||||
v *= 2;
|
v *= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -252,11 +252,11 @@ copying to take place:
|
|||||||
using namespace pybind11::literals; // for "arg"_a
|
using namespace pybind11::literals; // for "arg"_a
|
||||||
py::class_<MyClass>(m, "MyClass")
|
py::class_<MyClass>(m, "MyClass")
|
||||||
// ... other class definitions
|
// ... other class definitions
|
||||||
.def("some_method", &MyClass::some_method, py::arg().nocopy());
|
.def("some_method", &MyClass::some_method, py::arg().noconvert());
|
||||||
|
|
||||||
m.def("some_function", &some_function,
|
m.def("some_function", &some_function,
|
||||||
"big"_a.nocopy(), // <- Don't allow copying for this arg
|
"big"_a.noconvert(), // <- Don't allow copying for this arg
|
||||||
"small"_a // <- This one can be copied if needed
|
"small"_a // <- This one can be copied if needed
|
||||||
);
|
);
|
||||||
|
|
||||||
With the above binding code, attempting to call the the ``some_method(m)``
|
With the above binding code, attempting to call the the ``some_method(m)``
|
||||||
|
Loading…
Reference in New Issue
Block a user