Thread overview
debug public release private
Jul 25, 2016
Gorge Jingale
Jul 25, 2016
Cauterite
Jul 25, 2016
Jonathan M Davis
July 25, 2016
debug mixin("public"); else mixin("private");

Doesn't work.

It's nice to have public members when debugging because they show up in the debugger and one can access internals for checking. One can enable per line using debug but it requires lots of duplicate code.


Is there any easy way to do this?


July 25, 2016
On Monday, 25 July 2016 at 04:58:55 UTC, Gorge Jingale wrote:
> debug mixin("public"); else mixin("private");

Perhaps you could build a patched DMD which ignores 'private'. Then when you want to compile with -debug, use this custom DMD, and use the standard DMD the rest of the time.

I imagine it'd be a pretty simple patch, but I'm not certain.
July 25, 2016
On Monday, July 25, 2016 04:58:55 Gorge Jingale via Digitalmars-d-learn wrote:
> debug mixin("public"); else mixin("private");
>
> Doesn't work.
>
> It's nice to have public members when debugging because they show up in the debugger and one can access internals for checking. One can enable per line using debug but it requires lots of duplicate code.
>
>
> Is there any easy way to do this?

What kind of deubgger cares about public or private? I don't think that I've ever seen a debugger that did. Debuggers normally give you access to everything.

- Jonathan M Davis