Separate class declaration #4858
Unanswered
acaly
asked this question in
Language Ideas
Replies: 1 comment 3 replies
-
It looks like what you want is abstract classes which already exist. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Currently it seems to be difficult to separate the declaration and implementation of classes in C#. For example, if one writes a cross-platform GUI framework like Avalonia, the backends (D3D, OpenGL, etc.) need to provide a unified API. This is usually done with C# interfaces today, but there are limitations:
sealed
, the runtime don't know whether other implementations exist). For small methods, reducing the indirection and inlining should give a big improvement.So it would be great if we can have a feature to separate declaration and definition.
Proposed syntax
Definitions:
Implementations:
User of the library:
Notes
Beta Was this translation helpful? Give feedback.
All reactions