C# Version 11.0 | |
Released November, 2022 | |
The following features were added in C# 11: | |
⮚Raw string literals | |
⮚Generic math support | |
⮚Generic attributes | |
⮚UTF-8 string literals | |
⮚Newlines in string interpolation expressions | |
⮚List patterns | |
⮚File-local types | |
⮚Required members | |
⮚Auto-default structs | |
⮚Pattern match Span | |
⮚Extended nameof scope | |
⮚Numeric IntPtr | |
⮚ref fields and scoped ref | |
⮚Improved method group conversion to delegate | |
⮚Warning wave 7 | |
C# 11 introduces generic math and several features that support that goal. You can write numeric algorithms once for all number types. There's more features to make working with struct types easier, like required members and auto-default structs. Working with strings gets easier with Raw string literals, newline in string interpolations, and UTF-8 string literals. Features like file local types enable source generators to be simpler. Finally, list patterns add more support for pattern matching. |