May 01
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
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.