Request assistance converting C's #ifndef to D

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 13 09:07:02 PDT 2016


On Thursday, 12 May 2016 at 22:51:17 UTC, Andrew Edwards wrote:
> The following preprocessor directives are frequently 
> encountered in C code, providing a default constant value where 
> the user of the code has not specified one:
>
> 	#ifndef MIN
> 	#define MIN     99
> 	#endif
>
> 	#ifndef MAX
> 	#define MAX     999
> 	#endif

If you're ok with runtime values

int MIN=99, MAX=999;

And let user assign different values to them.


More information about the Digitalmars-d-learn mailing list