Skip to content

Commit 7629f32

Browse files
Implement entities showing static virtual in interface
1 parent f747d15 commit 7629f32

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
public struct Duplicate : IGetDuplicated<Duplicate>
2+
{
3+
public int _num;
4+
5+
public Duplicate(int num)
6+
{
7+
_num = num;
8+
}
9+
10+
public static Duplicate operator ++(Duplicate other)
11+
=> other with { _num = other._num + other._num };
12+
13+
public override string ToString() => _num.ToString();
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
public interface IGetDuplicated<T> where T : IGetDuplicated<T>
2+
{
3+
static virtual T operator ++(T other) => throw new NotImplementedException();
4+
}

0 commit comments

Comments
 (0)