mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
Docs: describe how to create multidimensional std::Array (#407)
doc: descirbe how to create multidimensional std::Array Co-authored-by: paxcut <53811119+paxcut@users.noreply.github.com>
This commit is contained in:
@@ -6,6 +6,22 @@ import std.core;
|
|||||||
/*!
|
/*!
|
||||||
The array library contains a helper type to make it easier to create multi-dimensional arrays
|
The array library contains a helper type to make it easier to create multi-dimensional arrays
|
||||||
and pass arrays to functions as parameters.
|
and pass arrays to functions as parameters.
|
||||||
|
|
||||||
|
## Multi-dimensional arrays
|
||||||
|
|
||||||
|
The following example shows how to use multi-dimensional arrays with structs.
|
||||||
|
|
||||||
|
```rust
|
||||||
|
import std.array;
|
||||||
|
|
||||||
|
struct File {
|
||||||
|
u8 width, height;
|
||||||
|
std::Array<std::Array<u8, parent.width>, height> cells;
|
||||||
|
};
|
||||||
|
|
||||||
|
File file @ 0x00;
|
||||||
|
```
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace auto std {
|
namespace auto std {
|
||||||
|
|||||||
Reference in New Issue
Block a user