Skip to content

Commit 06904b9

Browse files
Update PushFuture.md
1 parent e87ca83 commit 06904b9

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Documentation/Stack/PushFuture.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,23 @@ public void PushFuture()
1313
Exception
1414
```
1515
If there is no place for the element in the collection
16+
17+
## Example
18+
19+
```C#
20+
21+
unsafe
22+
{
23+
using (var memory = new StackMemoryCollections.Struct.StackMemory(sizeof(int) * 10))
24+
{
25+
using var stack = new StackMemoryCollections.Struct.StackOfInt32(10, &memory);
26+
for (int i = 0; i < 10; i++)
27+
{
28+
int* futureTop = stack.TopFuture();
29+
*futureTop = i;
30+
stack.PushFuture();
31+
}
32+
}
33+
}
34+
35+
```

0 commit comments

Comments
 (0)