Lack of Operations for InlineArray #95741
Answered
by
gfoidl
YT-GameMaker
asked this question in
General
|
Static methods in |
Answered by
gfoidl
Dec 7, 2023
Replies: 1 comment
|
For you other operator-wishes also just use span, e.g. using System.Runtime.CompilerServices;
Foo foo = new();
foo[3] = 42;
foo[9] = 3;
Span<int> span = foo;
span.Sort();
for (int i = 0; i < span.Length; ++i)
{
Console.WriteLine(span[i]);
}
[InlineArray(10)]
public struct Foo
{
private int _value;
} |
0 replies
Answer selected by
YT-GameMaker
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
InlineArrayis a struct, so just "clear" it withmyInlineArray = default.Or access it as span and use
Span.Clear-method.For you other operator-wishes also just use span, e.g.