<atomic>: Add member difference_type to atomic<void*> and its friends#4689
Conversation
cf53dba to
70cae8c
Compare
It seems intentional that `atomic(_ref)<T*>` are SFINAE-friendly on atomic pointer arithmetic. So this PR adds another mediate base class to avoid breaking the SFINAE-friendliness. Also updates the comments in `Dev11_0863628_atomic_compare_exchange/test.cpp` to cite WG21-N4981.
53d9258 to
1cb0715
Compare
I don't think that matches the standard, which uses "Mandates" ([atomics.types.pointer]/5, [atomics.ref.pointer]/3). |
Mandates doesn't mean the ill-formedness shall be SFINAE-unfriendly, although we ususally use Previously, #4014 made Mandates for Edit: see also #3013 (comment). |
|
Thanks for the quick fix and comprehensive test coverage, this is great! 😻 |
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
|
Thanks for making a difference! 😹 🤪 💚 |
|
😹Well, we should partially revert this for |
Fixes #4688.
It seems intentional that
atomic(_ref)<T*>are SFINAE-friendly on atomic pointer arithmetic. So this PR adds another mediate base class to avoid breaking the SFINAE-friendliness.Also updates the comments in
Dev11_0863628_atomic_compare_exchange/test.cppto cite WG21-N4981.