It's a more concise way of writing:
    GetConsoleCP() != 0

You can do this in C/C++ as well (and presumably some other languages).

Hmmm... thinking about it, it does make perfect sense. The first ! converts it to bool, the other inverts it back to it's positive/negative state.

Wouldn't this just be the same as
auto hasConsole = cast(bool) GetConsoleCP(); ?

I think the GetConsoleCP() != 0 code is the clearest about your intentions.


  • W... Ryan via Digitalmars-d-learn
    • ... Xinok via Digitalmars-d-learn
      • ... Era Scarecrow via Digitalmars-d-learn
        • ... Is it possible to store different generic types? via Digitalmars-d-learn
          • ... Is it possible to store different generic types? via Digitalmars-d-learn
            • ... Ryan via Digitalmars-d-learn
              • ... Adam D. Ruppe via Digitalmars-d-learn
                • ... Patrick Schluter via Digitalmars-d-learn

Reply via email to