Detect 8-bit alligned type TXY by TX,TY.
Vitaliy Fadeev
vital.fadeev at gmail.com
Tue Sep 19 05:36:47 UTC 2023
Detect 8-bit alligned type TXY by TX,TY.
```d
union
{
struct
{
TX x;
TY y;
}
TXY xy;
}
alias TXY = Detect!(TX,TY);
```
Wanted:
```d
Detect( uint, uint ) == ulong;
Detect( uint, ubyte ) == ulong;
Detect( ushort, ushort ) == uint;
Detect( ushort, ubyte ) == uint;
```
Is there a D-trait or D-function for detect TXY (named for
example ```Detect``` in code above) ?
More information about the Digitalmars-d-learn
mailing list