summaryrefslogtreecommitdiffhomepage
path: root/docs/cspan_api.md
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-04 23:24:54 +0100
committerTyge Løvset <[email protected]>2023-02-04 23:24:54 +0100
commitd2ff84c53aa9bd3857fdf22dcf7cd9398a4780be (patch)
tree4923f88afb0d091d5d39ae03d65a4998a0517652 /docs/cspan_api.md
parent626b893b4d9e048c27571bfa28352914f2cd2bbc (diff)
downloadSTC-modified-d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be.tar.gz
STC-modified-d2ff84c53aa9bd3857fdf22dcf7cd9398a4780be.zip
Fix in ccommon.h to make MSVC work again (without -std:c11) + small adjustments.
Diffstat (limited to 'docs/cspan_api.md')
-rw-r--r--docs/cspan_api.md4
1 files changed, 2 insertions, 2 deletions
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 <c11/fmt.h>
#include <stc/cspan.h>