From d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Sat, 4 Feb 2023 23:24:54 +0100 Subject: Fix in ccommon.h to make MSVC work again (without -std:c11) + small adjustments. --- docs/cspan_api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/cspan_api.md') diff --git a/docs/cspan_api.md b/docs/cspan_api.md index 650260a2..d0463b0a 100644 --- a/docs/cspan_api.md +++ b/docs/cspan_api.md @@ -18,8 +18,7 @@ using_cspan3(S, ValueType); // define span types S, S2, S3 with ran using_cspan4(S, ValueType); // define span types S, S2, S3, S4 with ranks 1, 2, 3, 4. ``` ## Methods -Note that `cspan_md()`, `cmake_from*()`, `cspan_atN()`, `and cspan_subspanN()` require a (safe) cast to its span-type -on assignment, but not on initialization of a span variable. All functions are type-safe, and arguments are side-effect safe, except for SpanType arg. which must not have side-effects. +All functions are type-safe, and index arguments are side-effect safe. ```c SpanTypeN cspan_md(ValueType* data, intptr_t xdim, ...); // create a multi-dimensional cspan SpanType cspan_make(T SpanType, {v1, v2, ...}); // make a 1d-dimensional cspan from values @@ -129,6 +128,7 @@ int main() { } ``` ## Example 2 +Slicing cspan without and with reducing the rank (like numpy array slicing): ```c #include #include -- cgit v1.2.3