diff --git a/docs/api_core.rst b/docs/api_core.rst index 36505974a..e14d7182f 100644 --- a/docs/api_core.rst +++ b/docs/api_core.rst @@ -2130,11 +2130,12 @@ Miscellaneous .. cpp:struct:: template typed - This helper class provides an an API for overriding the type annotation of - a function argument in generated docstrings. It is particularly helpful - when the type signature is not obvious and must be computed at compile time. - Otherwise, the :cpp:class:`raw_doc` attribute provides a simpler - alternative for taking full control of docstrings and type annotations. + This helper class provides an an API for overriding the type + annotation of a function argument or return value in generated + docstrings. It is particularly helpful when the type signature is + not obvious and must be computed at compile time. Otherwise, the + :cpp:class:`raw_doc` attribute provides a simpler alternative for + taking full control of docstrings and type annotations. Consider the following binding that iterates over a Python list. diff --git a/include/nanobind/nb_cast.h b/include/nanobind/nb_cast.h index b35fdae98..e646098c5 100644 --- a/include/nanobind/nb_cast.h +++ b/include/nanobind/nb_cast.h @@ -220,7 +220,7 @@ template struct type_caster> { return true; } - static handle from_cpp(const T &src, rv_policy policy, + static handle from_cpp(const T2 &src, rv_policy policy, cleanup_list *cleanup) noexcept { return Caster::from_cpp(src.value, policy, cleanup); }