Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created November 19, 2020 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ufcpp/81d1837c65f9c8319680297c3b40f1ca to your computer and use it in GitHub Desktop.
Save ufcpp/81d1837c65f9c8319680297c3b40f1ca to your computer and use it in GitHub Desktop.
init
using System;
var s = new S { I = 1 };
Console.WriteLine(s.I);
readonly struct S
{
readonly int _i;
public int I { get => _i; init => _i = value; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment