---------------------------
New features
^^^^^^^^^^^^
* Several :cpp:class:`nb::ndarray\<..\> <ndarray>` improvements:
1. CPU loops involving nanobind ndarrays weren't getting properly vectorized.
This release of nanobind adds *views*, which provide an efficient
abstraction that enables better code generation. See the documentation
section on :ref:`array views <ndarray-views>` for details.
(commit `8f602e
<https://github.com/wjakob/nanobind/commit/8f602e187b0634e1df13ba370352cf092e9042c0>`__).
2. Added support for nonstandard arithmetic types (e.g., ``__int128`` or
``__fp16``) in ndarrays. See the :ref:`documentation section
<ndarray-nonstandard>` for details. (commit `49eab2
<https://github.com/wjakob/nanobind/commit/49eab2845530f84a1f029c5c1c5541ab3c1f9adc>`__).
3. Shape constraints like :cpp:class:`nb::shape\<nb::any, nb::any, nb::any\>
<shape>` are tedious to write. Now, there is a shorter form:
:cpp:class:`nb::ndim\<3\> <ndim>`. (commit `1350a5
<https://github.com/wjakob/nanobind/commit/1350a5e15b28e80ffc2130a779f3b8c559ddb620>`__).
4. Added an explicit constructor that can be used to add or remove ndarray
constraints. (commit `a1ac207
<https://github.com/wjakob/nanobind/commit/a1ac207ab82206b8e50fe456f577c02270014fb3>`__).
* Added the wrapper class :cpp:class:`nb::weakref <weakref>`. (commit `78887f
<https://github.com/wjakob/nanobind/commit/78887fc167196a7568a5cef8f8dfbbee09aa7dc4>`__).
* Added the methods :cpp:func:`nb::dict::contains() <dict::contains>` and
:cpp:func:`nb::mapping::contains() <mapping::contains>` to the Python type
wrappers. (commit `64d87a
<https://github.com/wjakob/nanobind/commit/64d87ae01355c247123613f140cef8e71bc98fc7>`__).
* Added :cpp:func:`nb::exec() <exec>` and :cpp:func:`nb:eval() <eval>`. (PR `299
<https://github.com/wjakob/nanobind/pull/299>`__).
* Added a type caster for ``std::complex<T>``. (PR `292
<https://github.com/wjakob/nanobind/pull/292>`__, commit `dcbed4
<https://github.com/wjakob/nanobind/commit/dcbed4fe1500383ad1f4dff47cacbf0f2e6b1d3f>`__).
* Added an officially supported sample implementation of :ref:`intrusive
reference counting <intrusive>` via the :cpp:class:`intrusive_counter`
:cpp:class:`intrusive_base`, and :cpp:class:`ref` classes. (commit `3fa1af
<https://github.com/wjakob/nanobind/commit/3fa1af5e9e6fd0b08d13e16bb425a18963854829>`__).
Bugfixes
^^^^^^^^
* Fixed a serious issue involving combinations of bound types (e.g., ``T``) and
type casters (e.g., ``std::vector<T>``), where nanobind was too aggressive in
its use of *move semantics*. Calling a bound function from Python taking such
a list (e.g., ``f([t1, t2, ..])``) would destruct ``t1, t2, ..`` if the type
``T`` exposed a move constructor, which is highly non-intuitive and no
longer happens as of this fix.
Further investigation also revealed inefficiencies in the previous
implementation where moves were actually possible but not done (e.g., for
functions taking an STL vector by value). Some binding projects may see
speedups as a consequence of this change. (issue `307
<https://github.com/wjakob/nanobind/issues/307>`__, commit `122015
<https://github.com/wjakob/nanobind/commit/1220156961ce2d0c96a525f3c27b88e824b997ce>`__).