Title
T1 is convertible to T2
Status
new
Section
[library]
Submitter
Jens Maurer

Created on 2018-04-24.00:00:00 last changed 18 months ago

Messages

Date: 2023-06-15.00:00:00

[ 2023-06-24; Daniel comments ]

This issue has very much overlap with LWG 484.

Date: 2018-06-18.00:00:00

[ 2018-06-18 after reflector discussion ]

Priority set to 3

Date: 2018-04-24.00:00:00

The library wording frequently uses the construction "type T1 is convertible to type T2", but this is an undefined phrase.

For requirements on user code (e.g. [tuple.rel]), it is unclear whether all expressions of type T1 must satisfy the convertibility requirement, regardless of value category, or whether a single value category is in view only.

Consider:

struct C 
{
  operator int() &&;
};

int main()
{
  int x = C(); // prvalue can be implicitly converted to int
  C c;
  int y = c;   // lvalue can't
}

The library has an "is_convertible<T1, T2>" trait, but that checks convertibility only for a single value category, not all possible ones.

History
Date User Action Args
2023-06-25 11:13:37adminsetmessages: + msg13667
2018-06-19 05:49:11adminsetmessages: + msg9943
2018-04-24 00:00:00admincreate