-
Notifications
You must be signed in to change notification settings - Fork 807
Open
Labels
P3-OtherTriaged issue not in P1 or P2Triaged issue not in P1 or P2
Description
The example in [atomics.types.operations] Note 8 currently reads:
union pony {
double celestia = 0.;
short luna; // padded
};
atomic<pony> princesses = {};
bool party(pony desired) {
pony expected;
return princesses.compare_exchange_strong(expected, desired);
}In common implementations, pony have the same size as double and a default- or value-initialized pony doesn't have any bit with indeterminate value. So it's questionable to me whether this example serves its purpose. Would it make more sense to initialize the short member instead?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3-OtherTriaged issue not in P1 or P2Triaged issue not in P1 or P2