N2369 editorial/defect: New constexpr c'tors of complex are not constant expression c'tors
The incorporation of the new constexpr facility into the last recent
draft has lead to some invalid
c'tor definitions, because their arguments are not literal types.
These are:
[complex.special]:
In template<> class complex<float>:
explicit constexpr complex(const complex<double>&);
explicit constexpr complex(const complex<long double>&);
In template<> class complex<double>:
constexpr complex(const complex<float>&);
explicit constexpr complex(const complex<long double>&);
In template<> class complex<long double>:
constexpr complex(const complex<float>&);
constexpr complex(const complex<double>&);
Proposed resolution:
Replace above mentioned c'tor declarations by the following ones:
In template<> class complex<float>:
explicit constexpr complex(complex<double>);
explicit constexpr complex(complex<long double>);
In template<> class complex<double>:
constexpr complex(complex<float>);
explicit constexpr complex(complex<long double>);
In template<> class complex<long double>:
constexpr complex(complex<float>);
constexpr complex(complex<double>);
Greetings from Bremen,
Daniel
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]