totally_ordered_wrapper: make ctor noexcept

Copying pointers is noexept.

Adding unconditional noexcept doesn't limit us to switch to
conditional noexcept going forward, because any P for which
copy-construction isn't noexcept is currently excluded by the
static_assert(is_pointer).

Change-Id: I475e6294515a4c76bb31974cd6fd458fb0c0d42e
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Marc Mutz 2024-05-29 08:40:49 +02:00
parent ccb8efbfe5
commit 9dbe681218

View File

@ -619,7 +619,7 @@ class totally_ordered_wrapper
P ptr; P ptr;
public: public:
explicit constexpr totally_ordered_wrapper(P p) : ptr(p) {} explicit constexpr totally_ordered_wrapper(P p) noexcept : ptr(p) {}
constexpr P get() const noexcept { return ptr; } constexpr P get() const noexcept { return ptr; }
constexpr P operator->() const noexcept { return get(); } constexpr P operator->() const noexcept { return get(); }