www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - aliasing private

reply NotYouAgain <NotYouAgain gmail.com> writes:
I want to do a C like #define on private, but I can't

ie. #define private fileprivate

// ---
module m;

alias fileprivate = private; // grr!

class myClass
{
    fileprivate int n;
}

// ---
May 01
parent user1234 <user1234 12.de> writes:
On Wednesday, 1 May 2024 at 12:07:26 UTC, NotYouAgain wrote:
 I want to do a C like #define on private, but I can't

 ie. #define private fileprivate

 // ---
 module m;

 alias fileprivate = private; // grr!

 class myClass
 {
    fileprivate int n;
 }

 // ---
You cant. That is simply not supported.
May 01