Title
Associated conversion functions converting to the same type
Status
concepts
Section
11.4.8.3 [class.conv.fct]
Submitter
Daniel Krügler

Created on 2009-04-19.00:00:00 last changed 179 months ago

Messages

Date: 2009-04-19.00:00:00

11.4.8.3 [class.conv.fct] paragraph 1 says,

A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) base class of that type (or a reference to it), or to (possibly cv-qualified) void.

Does this mean that the following example is ill-formed?

    auto concept Convertible<typename T, typename U> {
      operator U(const T&);
    }

    template <typename T, typename U>
    requires Convertible<T, U>
    U convert(const T& t) { return t; }

    int main() {
      convert<int>(42);
    }
History
Date User Action Args
2009-08-03 00:00:00adminsetstatus: open -> concepts
2009-04-19 00:00:00admincreate