
this implies that one can only use atomic integral types in shared memory, but not std::atomic<>, because the std::atomic<> template has a per-instance is_lock_free member.
29.4/2: "The function atomic_is_lock_free (29.6) indicates whether the object is lock-free. In any given program execution, the result of the lock-free query shall be consistent for all pointers of the same type."
The query is not per-instance. It can't be performed at compile time though (this is probably motivated by instruction set differences like the famous 386-486 divide where the program can only know at run time whether general atomics are available).
isn't atomic_is_lock_free only defined for integral types? and why isn't atomic::is_lock_free a static member function? dispatching per-object would actually make sense, because there may be platforms which require objects to be aligned to certain memory boundaries for double-width CAS. cheers, tim