[cpp-threads] atomic operations package

Peter Dimov pdimov at mmltd.net
Thu Aug 25 15:17:08 BST 2005


Boehm, Hans wrote:

> In my view, the atomic<> template actually buys us something,
> in that it can be applied to enumeration types, etc.

There is no reason for a function-style atomic intrinsic to not work on 
arbitrary POD types, as long as their sizes and alignments satisfy the 
atomicity constraints.

We may (or may not) want to provide an atomic<T> wrapper that enforces the 
appropriate size or alignment for some Ts (enums, chars), but this is a 
separate "convenience" addition and not a necessity. I'd omit it. 





More information about the cpp-threads mailing list