Namespaces
Variants
Actions

Talk:cpp/atomic/atomic/fetch add

From cppreference.com

Concerning:

== Returns == The value of the atomic variable before the call.

IMHO, this is not precise enough. These operations are functions, there can be a true function call that consists of more than just the atomic operation. C++14 IS uses the following wording [emphasis mine]:

Returns: Atomically, the value pointed to by object or by this immediately before the effects. C++14 IS §29.6.5 [atomics.types.operations.req] p29

This affects several pages.

dyp --84.162.5.25 14:11, 22 March 2015 (PDT)

sounds reasonable, perhaps it could even be phrased with a chance for a wikilink, like "Returns the value that appears in the modification order of *object immediately before the read-modify-write operation performed by this function". --Cubbi (talk) 06:29, 23 March 2015 (PDT)