DIP62: Volatile type qualifier for unoptimizable variables in embedded programming
Meta via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jul 15 11:13:26 PDT 2014
On Tuesday, 15 July 2014 at 17:50:13 UTC, Johannes Pfau wrote:
> Then we have a templated struct. Which generates TypeInfo for
> every
> instance. Which might generate an Initializer for every
> instance and
> it might generate extended debug info for every instance.
>
> These are exactly the kind of workarounds I don't want. Sure we
> can
> make it work: @noTypeInfo @noInit @noDebug (struct volatile).
> But then
> I don't see why we don't just use the proposal in this DIP.
> It's less
> complicated, has got fewer corner case, ...
>
> And that's why I say first class support: We don't have
> shared!(T) we
> have shared T. And volatile should get it's own qualifier as
> well.
>
> Also some things will just not work with Volatile!T, for example
> volatile/nonvolatile member function overloading.
Functions can take Volatile!T, of course, and you can always have
"set/volatileSet". You might even be able to use opDispatch to
make it less DRY.
More information about the Digitalmars-d
mailing list