Edit: The code here still has some bugs in it, and it could do better in the performance department, but instead of trying to fix this, for t
I would seriously advise against public inheritance. I don't know what the atomic implementation is like, but im assuming it has overloaded operators that use it as the integral type, which means that those promotions will be used instead of your float in many (maybe most?) cases.
I don't see any reason why that wouldn't work, but like you I have to way to prove that...
One note: your operator float()
routine does not have load-acquire semantics, and shouldn't it be marked const volatile (or definitely at least const)?
EDIT: If you are going to provide operator--() you should provide both prefix/postfix forms.