digitalmars.D.learn - Nested class defined in another file
- Bruno Deligny (5/5) Jun 03 2013 Hi,
- bearophile (8/11) Jun 03 2013 This is a solution, but it's not nice:
- Bruno Deligny (7/19) Jun 03 2013 I only have 5 classes nested into one but it sufficient to make
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/8) Jun 03 2013 Have you considered the 'package' access specifier? It allows access to
- Flamaros (2/13) Jun 04 2013 It seems exactly what we are looking for. Thx.
- bearophile (7/9) Jun 03 2013 In D there is no C++ friend nor classes split as in C#. D Classes
Hi, I want to separate nested classes in multiple files to increase readability but i need to keep the access to parent members. Is it possible? Thx
Jun 03 2013
Bruno Deligny:I want to separate nested classes in multiple files to increase readability but i need to keep the access to parent members. Is it possible?This is a solution, but it's not nice: mixin(import("filename1")); mixin(import("filename2")); ... Why do you need so much/so many nested classes? Bye, bearophile
Jun 03 2013
On Monday, 3 June 2013 at 22:07:15 UTC, bearophile wrote:Bruno Deligny:I only have 5 classes nested into one but it sufficient to make the code difficult to read. I began to separate them by hand by passing a parent reference but it's ugly because i need to make the parent members accessible in public to have acces. Is there any "friend" like in C++ to keep them private to others?I want to separate nested classes in multiple files to increase readability but i need to keep the access to parent members. Is it possible?This is a solution, but it's not nice: mixin(import("filename1")); mixin(import("filename2")); ... Why do you need so much/so many nested classes? Bye, bearophile
Jun 03 2013
On 06/03/2013 03:20 PM, Bruno Deligny wrote:I began to separate them by hand by passing a parent reference but it's ugly because i need to make the parent members accessible in public to have acces. Is there any "friend" like in C++ to keep them private to others?Have you considered the 'package' access specifier? It allows access to the modules of the same package but not to others. Ali
Jun 03 2013
On Monday, 3 June 2013 at 22:39:39 UTC, Ali Çehreli wrote:On 06/03/2013 03:20 PM, Bruno Deligny wrote:It seems exactly what we are looking for. Thx.I began to separate them by hand by passing a parentreference but it'sugly because i need to make the parent members accessible inpublic tohave acces. Is there any "friend" like in C++ to keep themprivate toothers?Have you considered the 'package' access specifier? It allows access to the modules of the same package but not to others. Ali
Jun 04 2013
Bruno Deligny:Is there any "friend" like in C++ to keep them private to others?are supposed to be written in a single file. I have shown you a rough solution with import. Maybe others will give you more suggestions. Bye, bearophile
Jun 03 2013