November 09 Issues » [Issue 24850] New: Named enum construction from base type is inconsistent | |||
|---|---|---|---|
| |||
...convert to the enum type. But this compiles:
```
struct S {
this(int) {}
}
enum E : S... | |||
November 09 DIP Ideas » Re: Named constructors | |||
|---|---|---|---|
| |||
...can be simulated through, nested classes:
```d
enum PI=3.141592f;
class Angle
{
float radians... | |||
November 09 Learn » Re: Why doesn't `opAssign` work for my templated struct? | |||
|---|---|---|---|
| |||
...the base type. https://dlang.org/spec/enum.html#named_enums I'm not sure... | |||
November 08 Learn » Re: Why doesn't `opAssign` work for my templated struct? | |||
|---|---|---|---|
| |||
...dummyNumbericFunction(T)(T t){
auto foo=t+t;
...
}
enum isNumbertic(T)=__traits(compiles,dummyNumbericFunction!T);
``` | |||
November 08 Learn » Why doesn't `opAssign` work for my templated struct? | |||
|---|---|---|---|
| |||
...if(isNumeric!T) {
value = v;
}
}
enum Milligrams : BaseUnit!Milligrams;
enum Millimoles : BaseUnit!Millimoles;
unittest {
Milligrams... | |||
November 06 Issues » [Issue 24845] Compiler error when trying to assign to an AA value of an enum instance | |||
|---|---|---|---|
| |||
...value of an |to assign to an AA value of
|enum instance |an enum instance
-- | |||
November 06 Issues » [Issue 24845] New: Compiler error when trying to access AA value of an enum instance | |||
|---|---|---|---|
| |||
...trying to access AA value of an
enum instance
Product: D
Version: D2
Hardware: x86... | |||
November 03 DIP Ideas » Re: Allow designated initialization of struct | |||
|---|---|---|---|
| |||
...stable language
```C
#include <assert.h>
typedef enum {
One, Two, Three, Four
} Numbers;
typedef struct... | |||
November 01 DIP Ideas » Re: Allow designated initialization of struct | |||
|---|---|---|---|
| |||
...42} } } );
}
```
This builds
This also build:
```C
enum State
{
IDLE,
RUN,
ATTACK,
}
fn void main... | |||
October 31 DIP Ideas » Re: Allow Conditional Compilation Inside Enum Declaration | |||
|---|---|---|---|
| |||
Yesterday I was thinking to add that feature to another language (understand "one where there... | |||
Copyright © 1999-2021 by the D Language Foundation