3045. atomic<floating-point> doesn't have value_type or difference_type

Section: [atomics.types.float] Status: C++20 Submitter: Tim Song Opened: 2017-12-11 Last modified: 2021-02-25 10:48:01 UTC

Priority: 0

View all issues with C++20 status.


The atomic<floating-point> specialization doesn't have the value_type and difference_type member typedefs, making it unusable with most of the nonmember function templates. This doesn't seem to be the intent.

[ 2018-01-09 Moved to Tentatively Ready after 6 positive votes on c++std-lib. ]

[2018-3-17 Adopted in Jacksonville]

Proposed resolution:

This wording is relative to N4713.

  1. Edit [atomics.types.float] after p1, class template specialization atomic<floating-point> synopsis, as indicated:

      namespace std {
        template<> struct atomic<floating-point> {
          using value_type = floating-point;
          using difference_type = value_type;
          static constexpr bool is_always_lock_free = implementation-defined;