You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The members of atomic and its specializations are currently presented in this order:
typedefs, traits, constants
lock_free stuff
stores and loads
compare exchange and fetch_*
wait and notify
constructors
assignment operators
compound assignment operators and inc/dec
That's far from our normal order, separates similar operations (fetch_* and compound assignment), and groups together completely different operations (simple assignment and compound assignment).
This order would seem substantially better:
typedefs, traits, constants, and lock_free stuff
constructors
stores, loads, and assignment operators
compare exchange and fetch_*, compound assignment operators, and inc/dec
wait and notify
atomic_ref is closer to this, but also has surprising ordering (its simple assignment is before its constructors, and its is_lock_free is not grouped with is_always_lock_free).
The text was updated successfully, but these errors were encountered:
I like having assignment near compound assignment even if their semantics differ significantly because of the obvious conceptual similarity and the lesser information returned. That's not an objection to your proposed order, since it can be made to preserve that property by putting compound assignment operators first in their bullet.
jensmaurer
changed the title
reorder members of atomic and atomic_ref to a more meaningful and conventional order
[atomics] reorder members of atomic and atomic_ref to a more meaningful and conventional order
Sep 24, 2019
The members of
atomic
and its specializations are currently presented in this order:That's far from our normal order, separates similar operations (fetch_* and compound assignment), and groups together completely different operations (simple assignment and compound assignment).
This order would seem substantially better:
atomic_ref
is closer to this, but also has surprising ordering (its simple assignment is before its constructors, and itsis_lock_free
is not grouped withis_always_lock_free
).The text was updated successfully, but these errors were encountered: