On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote:
Sorry if this is a stupid question but it eludes me. In the following, what is THING? What is SOME_THING?

    #ifndef THING
    #define THING
    #endif

    #ifndef SOME_THING
    #define SOME_THING THING *
    #endif

Is this equivalent to:

    alias thing = void;
    alias someThing = thing*;

Thanks,
Andrew

Hi Andrew
This is why need to learn more about C and C++ when I want to port them to D. You can get a bit of reading about C preprocessor here: https://www.tutorialspoint.com/cprogramming/c_preprocessors.htm

Regarding your question: I've been porting some C code with macros, they can be translated into D as aliases, functions, structs, templates, mixins etc. So maybe an excerpt from the real code would be more straight forward.

Reply via email to