Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion atomic.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ toc: true
# Revision History
## R1
- Added `noexcept` specifier.
- Changed constraints wording to say "`T` and `U` are similar types" per LWG feedback
- Added converting constructor to specializations for integral types
- Added converting constructor to specializations for floating-point types
- Added converting constructor to specializations for pointer types

## R0
- Initial revision
Expand Down Expand Up @@ -49,14 +53,41 @@ constexpr atomic_ref(const atomic_ref<U>& ref) noexcept;

[9]{.pnum} *Contraints*:

- [9.1]{.pnum} `is_same_v<remove_cv_t<T>, remove_cv_t<U>>` is `true`, and
- [9.1]{.pnum} `T` and `U` are similar types ([conv.qual]), and

- [9.2]{.pnum} `is_convertible_v<U*, T*>` is `true`

[10]{.pnum} *Postconditions*: `*this` references the object referenced by `ref`.

:::

Change [atomics.ref.int]{.sref} as follows:

```cpp
constexpr explicit atomic_ref(integral-type&);
constexpr atomic_ref(const atomic_ref&) noexcept;
@[`template <class U>`]{.add}@
@[`constexpr atomic_ref(const atomic_ref<U>&) noexcept;`]{.add}@
```

Change [atomics.ref.float]{.sref} as follows:

```cpp
constexpr explicit atomic_ref(floating-point-type&);
constexpr atomic_ref(const atomic_ref&) noexcept;
@[`template <class U>`]{.add}@
@[`constexpr atomic_ref(const atomic_ref<U>&) noexcept;`]{.add}@
```

Change [atomics.ref.pointer]{.sref} as follows:

```cpp
constexpr explicit atomic_ref(pointer-type&);
constexpr atomic_ref(const atomic_ref&) noexcept;
@[`template <class U>`]{.add}@
@[`constexpr atomic_ref(const atomic_ref<U>&) noexcept;`]{.add}@
```

# Implementation Experience

[@P3323R1] is currently being implemented in libc++ and adding the proposed constructor is under way.
Expand Down
Loading