Unsafe.As, readonly version #54789
-
Hi, we have Is there anything preventing It would be quite handy... :) |
Beta Was this translation helpful? Give feedback.
Answered by
huoyaoyuan
Jun 27, 2021
Replies: 1 comment 1 reply
-
I don't think so. You can do much less thing with readonly ref than regular ref. All interlocked or volatile apis accept Currently there is a workaround |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zugolbr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think so.
You can do much less thing with readonly ref than regular ref. All interlocked or volatile apis accept
ref
.Currently there is a workaround
Unsafe.As(Unsafe.AsRef())
. Since this is unsafe, I don't think we should make a shortcut.