Does is_nothrow_convertible consider destruction of the destination type?
Jiang An

Created on 2019-02-10.00:00:00 last changed 3 months ago


Date: 2020-03-11.00:00:00

[ 2020-03-11 Issue Prioritization ]

Priority to 3 after reflector discussion.

Date: 2020-02-15.00:00:00

[ 2020-02-22, Daniel comments ]

This seems to be quite related to the existing issue LWG 2116.

Date: 2019-02-10.00:00:00

This issue was submitted after a previous editorial change request had been rejected by the project editors.

I find that all known implementations (at least msvcstl, libc++, libstdc++ and the sample in P0758R1) of std::is_nothrow_convertible may be not clear enough to indicate that whether destruction of the destination type is considered (or not).

For example, given a type Weird defined as

struct Weird 
  Weird(int) noexcept {}
  ~Weird() noexcept(false) {}

Then std::is_nothrow_convertible_v<int, Weird> is false in every known implementation. However, it seems that the conversion itself is noexcept.

Date User Action Args
2020-03-11 18:59:36adminsetmessages: + msg11162
2020-02-22 10:19:06adminsetmessages: + msg11135
2019-02-10 00:00:00admincreate