DIP62: Volatile type qualifier for unoptimizable variables in embedded programming

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 15 11:09:42 PDT 2014


On Tuesday, 15 July 2014 at 17:50:13 UTC, Johannes Pfau wrote:
> 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.

Volatile has probably much smaller scope than shared. Shared 
memory is used more often and in more non-trivial ways, it's not 
unthinkable for even complex data structures to be shared or 
abstracted with an interface, so it makes sense that interfaces 
should support shared methods. Volatile is usually a small range 
of bytes (a communication device), which should be read once or 
written once.

D doesn't have a way of saving on typeinfos, so volatile is not 
alone in this respect. I'd prefer to see it applicable to 
anything (or rather everything).


More information about the Digitalmars-d mailing list