C++ Logo

std-proposals

Advanced search

Re: Deprecating volatile polymorphic class types

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Thu, 9 Jan 2020 16:40:18 -0500
On Thu, Jan 9, 2020 at 1:47 AM language.lawyer--- via Std-Proposals <
std-proposals_at_[hidden]> wrote:

>
> I find it weird that storage of objects of volatile polymorphic class
> types can be touched when a virtual function is invoked, which happens in
> all "typical" implementations which use vtables and vptrs stored in objects
> to implement polymorphic behavior.
> [...]
> What if we just deprecate volatile-qualified polymorphic class types (as
> well as [[pointers|references] to|arrays of] them)?
>

Sounds rational, but I also don't really see the point. `volatile` is like
`switch`: it sucks so much that nobody wants to touch it, not even to "fix"
it. Especially since your proposed change sounds like a new special case,
not a removal of special cases — your change would* increase* the length of
the paper standard, not decrease it.

If you want to pursue it, I recommend talking to JF Bastien, who may or may
not be interested in championing further "deprecating volatile" changes.
After his recent deprecations that got into C++2a, maybe the idea has
momentum, or maybe it's spent all its political capital, I'm not sure which.

HTH,
Arthur

Received on 2020-01-09 15:43:01