6 days ago Learn » Re: what's the use of empty structs in C-style languages ? | |||
|---|---|---|---|
| |||
...thing. They behave just like any other struct, and I've never seen any problems... | |||
6 days ago Learn » Re: volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
Ah... very nice. I completely missed that "alias this" could be used with a function... | |||
6 days ago Learn » Re: volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
On 12/2/24 12:27 PM, Josh Holtrop wrote: >> alias get this; > > If I... | |||
6 days ago Learn » Re: volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
...so that you can visualize it:
```d
struct FixedStr(size_t capacity)
{
char[capacity] data... | |||
6 days ago Learn » Re: volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
If I use `alias this` I don't know how I can get `volatileLoad()` to... | |||
6 days ago Learn » Re: volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
...this' may help: https://dlang.org/spec/struct.html#alias-this All you need to... | |||
6 days ago Learn » Re: what's the use of empty structs in C-style languages ? | |||
|---|---|---|---|
| |||
...of size being 1, today this passes:
struct S {}
void main() {
S[2] ses;
assert... | |||
6 days ago Learn » volatile struct definition for peripheral control registers | |||
|---|---|---|---|
| |||
...a `Volatile(T)` struct template: ```d module myproj.volatile; import core.volatile; struct Volatile(T... | |||
6 days ago Learn » what's the use of empty structs in C-style languages ? | |||
|---|---|---|---|
| |||
I've noticed that empty struct are always at least a size of 1, see... | |||
6 days ago Learn » Re: Variable modified by different threads. | |||
|---|---|---|---|
| |||
...import core.atomic;
import core.sync.mutex;
struct GlobalCounter
{
private Mutex mutex;
private shared int... | |||
Copyright © 1999-2021 by the D Language Foundation