27
1
using System;
2
3
public class Program
4
{
5
public static void Main()
6
{
7
var point = new Point { X = 5, Y = 10 };
8
int x1 = 0;
9
int y1 = 0;
10
(x1, y1) = point;
11
(int x2, int y2) = point;
12
int x3;
13
(x3, int y3) = point;
14
}
15
}
16
17
public struct Point
18
{
19
public int X {get; set;}
20
public int Y {get; set;}
21
22
public void Deconstruct(out int x, out int y)
23
{
24
x = X;
25
y = Y;
26
}
27
}
Cached Result