On Saturday, 7 November 2020 at 22:12:12 UTC, Arjan wrote:
What is the usage of `static` in this? :
```
static enum Status
{
NONE,
BUSY,
...
}
```
It's redundant
What is the usage of `static` in this? :
```
static enum Status
{
NONE,
BUSY,
...
}
```
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement, so it works only where statement is
allowed
On 03/11/15 15:41, ketmar via Digitalmars-d-learn wrote:
On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static
, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement, so it works only where statement is
allowed. the same is true for `version`. this is by design
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement
On Wednesday, March 11, 2015 14:55:01 Namespace via Digitalmars-d-learn wrote:
Thanks, I've hoped that 'static if' is a full replacement for #if
Walter Bright has a rather dim view of #if and friends in C/C++ given how
often he's seen them abused, which is why version and static if are more
UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement, so it works only where
statement is
allowed
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
nope. `static if` is statement
On Wed, 11 Mar 2015 14:36:07 +, wobbles wrote:
On Wednesday, 11 March 2015 at 14:34:32 UTC, ketmar wrote:
On Wed, 11 Mar 2015 13:48:45 +, Namespace wrote:
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any
This code does not work:
enum Test {
Foo,
static if (__VERSION__ = 2067)
Bar,
}
Quatz
}
Any chance that this could work?
Hi.
I have this structure:
struct MyStruct {
enum MyStruct VALUE = MyStruct(5f);
static immutable MyStruct value = MyStruct(5f);
float data;
this(float v) { data = v; }
}
What's the difference between MyStruct.VALUE and MyStruct.value?
How should I decide
On Thursday, 13 March 2014 at 14:38:27 UTC, ref2401 wrote:
Hi.
I have this structure:
struct MyStruct {
enum MyStruct VALUE = MyStruct(5f);
static immutable MyStruct value = MyStruct(5f);
float data;
this(float v) { data = v; }
}
What's the difference
thank you
On 03/13/2014 07:38 AM, ref2401 wrote:
Hi.
I have this structure:
struct MyStruct {
enum MyStruct VALUE = MyStruct(5f);
static immutable MyStruct value = MyStruct(5f);
float data;
this(float v) { data = v; }
}
What's the difference between MyStruct.VALUE and
15 matches
Mail list logo