On Thu, 29 May 2014 15:24:06 -0400, Dmitry Olshansky <dmitry.o...@gmail.com> wrote:

Let it be just a declaration, as simple as that. Attributes affect other declarations in the scope, static if doesn't.


Sure it does:

private:
   int a;
   int b;

equivalent to

private int a;
private int b;

static if(x):
   int a;
   int b;

equivalent to

static if(x) int a;
static if(x) int b;

;)

Yes, I agree static if does not fit the understood meaning of an attribute. And it can apply to statements too, whereas attributes can only apply to declarations (right?).

In reality, static if is in a league with version and debug, and they share similarities to both statements and attributes.

-Steve
  • Re: Scott Meyers' DConf 20... Walter Bright via Digitalmars-d-announce
    • Re: Scott Meyers' DCo... Brian Rogoff via Digitalmars-d-announce
      • Re: Scott Meyers'... Walter Bright via Digitalmars-d-announce
        • Re: Scott Mey... Brian Schott via Digitalmars-d-announce
        • Re: Scott Mey... Dmitry Olshansky via Digitalmars-d-announce
          • Re: Scott... Brian Schott via Digitalmars-d-announce
            • Re: ... Brian Rogoff via Digitalmars-d-announce
          • Re: Scott... Steven Schveighoffer via Digitalmars-d-announce
            • Re: ... Dmitry Olshansky via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
            • Re: ... deadalnix via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... Timon Gehr via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce
              • ... Steven Schveighoffer via Digitalmars-d-announce
          • Re: Scott... Walter Bright via Digitalmars-d-announce
            • Re: ... Steven Schveighoffer via Digitalmars-d-announce
            • Re: ... Dmitry Olshansky via Digitalmars-d-announce
              • ... Walter Bright via Digitalmars-d-announce

Reply via email to