Implementation of Rusts DeRef Trait for Reference Wrapping #8108
Unanswered
markusstephanides
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
Could you explain what the use cases would be for implementing such a struct? In Rust it sounds like the reason you'd want to use this pattern is to implement smart pointers that can be dereferenced like a normal pointer. That doesn't seem applicable/desirable to C#. |
Beta Was this translation helpful? Give feedback.
2 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.
-
Introduce a DeRef-like trait in C# to allow direct usage of wrapped types in structs, akin to Rust's DeRef Trait, enhancing syntactic convenience.
Rust Example:
C# using current language features
Proposed C# Example:
Beta Was this translation helpful? Give feedback.
All reactions