Add struct/class-scope private members #11
Replies: 6 comments 6 replies
-
As long as no "friends" are introduced along with that, I have no problem. |
Beta Was this translation helpful? Give feedback.
-
Wouldn't mind to have this, but please don't get to the point |
Beta Was this translation helpful? Give feedback.
-
I'd imagine like private(this) or something and otherwise things stay the same would be easy enough to do. |
Beta Was this translation helpful? Give feedback.
-
Doesn't |
Beta Was this translation helpful? Give feedback.
-
On a thread in the D forum someone came up with a real usecase for class-private (class invariants), and it became more clear to me that together with module-private 'friends' are not really needed (because if you would need them, simply change the member to module-private and you can have the necessary access). |
Beta Was this translation helpful? Give feedback.
-
It should be merged in the latest master fyi |
Beta Was this translation helpful? Give feedback.
-
Something like C++
private
where members are not accessible from outside of a class/struct even within the same file.Current D's
private
allows accessing within the same module.Beta Was this translation helpful? Give feedback.
All reactions