Skip to content

Commit

Permalink
adjust doc for custom constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasdiener authored and wjakob committed Aug 3, 2023
1 parent 1c462d6 commit 1f65061
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/porting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ the desired type.

.. code-block:: cpp
nb::class_<MyType>(m, "MyType")
.def(nb::init([](int) { return MyType(...); }));
py::class_<MyType>(m, "MyType")
.def(py::init([](int) { return MyType(...); }));
Unfortunately, the implementation of this feature was quite complex and
often required further internal calls to the move or copy
Expand Down

0 comments on commit 1f65061

Please sign in to comment.