Ability to reuse type alias
in another assembly with apply all encapsulation limitation
#7253
Unanswered
soroshsabz
asked this question in
Language Ideas
Replies: 2 comments 9 replies
-
I believe that this will fall out with extensions: #5497 Explicit extensions specifically allow for a zero-cost abstraction for a subtype of any existing type that can provide type safety and additional functionality through extension members. |
Beta Was this translation helpful? Give feedback.
9 replies
-
Beta Was this translation helpful? Give feedback.
0 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.
-
ITNOA
As you know in C# language we cannot use
using alias
in another assembly or in anotherusing alias
.In another word, we cannot using
using alias
as normal type, that transparent type declaration for users. this feature exist in C++ for many years, and it is very useful specially in generic complex type aliasing.for example I want to have something like below
and in another
class
(in same assembly or in another assembly) we want to use this type is natural way like belowor in another use case, I want to add scope to
using alias
in class inheritance model for examplethe
public using alias
provide this type globally for all users ofFoo
class, butprotected using alias
provide this type only for derived classes.in the end, I think if
using alias
behave likeusing
in C++ we can provide a better abstraction and encapsulation and decoupling of codes.thanks
Beta Was this translation helpful? Give feedback.
All reactions