Interfaces have always been a way to define a contract that classes must implement but was always limited to instance members.
In C# 11.0, you can now define static abstract or virtual members on an interface.
Code
C#
public interface IConcateable<T> where T:IConcateable<T>
{
static abstract T Concat(T a, T b);
}
C#
public interface IConcateable<T> where T:IConcateable<T>
{
T Concat(T other);
}
Notes
- This feature is part of the work in enabling generic math support