forked from wjakob/nanobind
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate const of ndarray from const of its data. (wjakob#491)
A static assertion ensures that the ``order`` and ``framework`` cannot be changed once set. For example, a template argument to ``view()`` can only change one of these if it has not been set. The scalar element type and the ``shape`` can be set multiple times, and the rightmost one takes effect. Thus, these can be changed by specifying template arguments to ``view()``. The read-only boolean, ``is_ro``, can be set either by specifying ``nb::ro`` or by specifying a const-qualified scalar element type. It is sticky. Once set, it cannot be cleared. So, a read-only view of writable data can be obtained, but not the reverse.
- Loading branch information
Showing
6 changed files
with
278 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.