C++ Logo

std-proposals

Advanced search

[std-proposals] Conditional copy ctor for std::map / std::unordered_map

From: Mingxin Wang <mingxwa_at_[hidden]>
Date: Tue, 28 Feb 2023 03:37:20 +0000
When instantiating `std::map` or `std::unordered_map`, the value type could be non-copyable (but movable). However, both class templates have copy ctors and assignments. I do not see any wording suggesting they shall be deleted like `std::optional` does ([optional.ctor] Remarks: This constructor is defined as deleted unless is_copy_constructible_v<T> is true. If is_trivially_copy_constructible_v<T> is true, this constructor is trivial.) Shall we refine the wording here?

Thanks,
Mingxin Wang

Received on 2023-02-28 03:37:26