SYNTAX

scoped parameter

Constrains escape of a ref-like parameter.

Formal Syntax & Structure

csharp syntaxcsharp
static int Count(scoped ReadOnlySpan<int> s) => s.Length;

Working Example

Example Snippetcsharp
// Documentary fragment; see linked lesson for context.static int Count(scoped ReadOnlySpan<int> s) => s.Length;
C# & .NET Reference