4 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
(That was a bit iffy, try this one instead) ```D import std.stdio; void main... | |||
4 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
...what would your scheme do for the struct equivalent of this, assuming it is even... | |||
5 days ago General » Re: Something like ADL from C++? | |||
|---|---|---|---|
| |||
...arg)if(!is(T==struct)){ return [1]; }
```
```d
module user_code;
struct S{}
ubyte[] serialise... | |||
5 days ago DIP Ideas » @property fields | |||
|---|---|---|---|
| |||
...protected int field;
}
struct Thing2 {
private int field;
}
```
If we have struct inheritance, then it... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
...stringof);
}
}
```
Will output:
```
Parent
Child
Parent
Child
```
Struct inheritance would have the same output.
There... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
...the exact in-memory layout of the struct so defined. Whereas AFAICT, the inheritance suggestion... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
I'm very wary of this, Walter is pretty against implicit conversions generally speaking. I... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
...struct in another, which is already possible. So one could have: ```C struct Foo; struct... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
C++ classes work in -betterC. Its not too difficult to implement down casting either. https... | |||
5 days ago DIP Ideas » Re: Struct inheritance | |||
|---|---|---|---|
| |||
...any form of classful behaviour (i.e. struct inheritance) in betterC, but that is obviously... | |||
Copyright © 1999-2021 by the D Language Foundation