On Monday, December 4, 2023 11:26:07 AM MST DLearner via Digitalmars-d-learn
wrote:
> Suppose we need a construct like:
> ```
> void main() {
>
> struct A {
>int I1;
>int I2;
>char X;
> }
>
> struct B {
>A Dummy;
>int Var1;
>int Var2;
>
On Tuesday, 5 December 2023 at 00:31:35 UTC, H. S. Teoh wrote:
On Mon, Dec 04, 2023 at 11:46:45PM +, DLearner via
Digitalmars-d-learn wrote: [...]
Basically, B corresponds to the whole record (and only a whole
record
can be read).
But the task only requires Var1 and Var2, the last two field
On Mon, Dec 04, 2023 at 11:46:45PM +, DLearner via Digitalmars-d-learn
wrote:
[...]
> Basically, B corresponds to the whole record (and only a whole record
> can be read).
> But the task only requires Var1 and Var2, the last two fields on the record.
> By putting all the irrelevant fields into
On Monday, 4 December 2023 at 23:16:27 UTC, thinkunix wrote:
DLearner via Digitalmars-d-learn wrote:
On Monday, 4 December 2023 at 21:55:29 UTC, Mike Shah wrote:
[...]
Is something like this what you had in mind?
```
void main() {
import std.stdio;
mixin template A() {
int I1;
DLearner via Digitalmars-d-learn wrote:
On Monday, 4 December 2023 at 21:55:29 UTC, Mike Shah wrote:
[...]
Is something like this what you had in mind?
```
void main() {
import std.stdio;
mixin template A() {
int I1;
int I2;
char X;
}
struct B {
mixin A;
On Monday, 4 December 2023 at 21:55:29 UTC, Mike Shah wrote:
[...]
Is something like this what you had in mind?
```
void main() {
import std.stdio;
mixin template A() {
int I1;
int I2;
char X;
}
struct B {
mixin A;
int Var1;
int Var2;
}
On Monday, 4 December 2023 at 18:26:07 UTC, DLearner wrote:
Suppose we need a construct like:
```
void main() {
struct A {
int I1;
int I2;
char X;
}
struct B {
A Dummy;
int Var1;
int Var2;
}
}
```
But do not want to give an explicit name (like 'Du
Suppose we need a construct like:
```
void main() {
struct A {
int I1;
int I2;
char X;
}
struct B {
A Dummy;
int Var1;
int Var2;
}
}
```
But do not want to give an explicit name (like 'Dummy' above) to
the A struct held within the B struct.
Just