Interpolated strings and SQL

Walter Bright newshound2 at digitalmars.com
Thu Jan 11 02:38:21 UTC 2024


On 1/10/2024 7:07 AM, Nickolay Bukreyev wrote:
> Zero-sized structs are never passed as arguments. Inlining is not 
> necessary to get rid of them.

Structs with no fields have a size of 1 byte for D and C++ structs, and 0 or 4 
for C structs (depending on the target). The rationale for a non-zero size is so 
that different structs instances will be at different addresses.

```d
struct S { }

void foo(S s);

void test(S s)
{
     foo(s);
}
```

```
                 push    RBP
                 mov     RBP,RSP
                 sub     RSP,8
                 push    dword ptr 010h[RBP]
                 call      _D5test43fooFSQm1SZv at PC32
                 add     RSP,010h
                 pop     RBP
                 ret
```


More information about the Digitalmars-d mailing list