+2013-04-22 Paolo Carlini <paolo.carlini@oracle.com>
+
+ N3669
+ * include/std/complex (complex<float>::real, complex<float>::imag,
+ complex<double>::real, complex<double>::imag,
+ complex<long double>::real, complex<long double>::imag): Declare
+ as const member functions.
+ * include/std/type_traits (integral_constant<>::operator value_type):
+ Likewise.
+
2013-04-22 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/57010
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
constexpr float
- real() { return __real__ _M_value; }
+ real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
constexpr float
- imag() { return __imag__ _M_value; }
+ imag() const { return __imag__ _M_value; }
#else
float&
real() { return __real__ _M_value; }
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
constexpr double
- real() { return __real__ _M_value; }
+ real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
constexpr double
- imag() { return __imag__ _M_value; }
+ imag() const { return __imag__ _M_value; }
#else
double&
real() { return __real__ _M_value; }
// DR 387. std::complex over-encapsulated.
__attribute ((__abi_tag__ ("cxx11")))
constexpr long double
- real() { return __real__ _M_value; }
+ real() const { return __real__ _M_value; }
__attribute ((__abi_tag__ ("cxx11")))
constexpr long double
- imag() { return __imag__ _M_value; }
+ imag() const { return __imag__ _M_value; }
#else
long double&
real() { return __real__ _M_value; }
static constexpr _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
- constexpr operator value_type() { return value; }
+ constexpr operator value_type() const { return value; }
};
template<typename _Tp, _Tp __v>