InternetException
  • Home
  • About
Sign in Subscribe
19 Oct 2022 .NET

`ref struct` types

  • added as part of C# 7.2.
  • defined with ref struct StructName
  • always on the stack
  • never part of heap
  • cannot be element of an array
  • cannot be field type of reference type
  • can't implement interfaces
  • can't be boxed
  • can't be type argument
  • can't be captured by closure of lambda or local function
  • can't be used in async methods
  • can't be used in iterators

Further read:

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct

Published by:

Natan Podbielski

You might also like...

18
Feb

Moving /boot partition

1 min read
18
Feb

Purging smtp services from Debian

1 min read
30
Oct

Enhancing your .NET API with query language

7 min read
28
Oct

HLinq design

18 min read
04
Oct

Disable Xunit Test on specific OS

1 min read
InternetException © 2026
  • Sign up
Powered by Ghost