ref-struct Questions

1

Consider the following methods (fiddle): void test(Span<int> param) { //Fail, the stackalloc'ed buffer could be exposed. param = stackalloc int[10]; } void test2(Span<int> param) { ...
Friarbird asked 28/4, 2021 at 11:59

1

C# 7.2 introduced ref structs. However, given a ref struct like this: public ref struct Foo { public int Bar; } I cannot use it as a type argument: int i = 0; var x = Unsafe.As<int, Foo>(re...
Thoracoplasty asked 15/6, 2018 at 7:41
1

© 2022 - 2024 — McMap. All rights reserved.