diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-04-22 14:37:34 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-04-22 14:37:34 +0000 |
commit | 9191d7a84aa904ae21bd4b8dd98100977e3b10a2 (patch) | |
tree | 8b3ef21b4574c51260d640bb39660a93ff2dedd8 | |
parent | 88a581daa7f2c350e061b12db8ed24a0417a6058 (diff) | |
download | gcc-9191d7a84aa904ae21bd4b8dd98100977e3b10a2.zip gcc-9191d7a84aa904ae21bd4b8dd98100977e3b10a2.tar.gz gcc-9191d7a84aa904ae21bd4b8dd98100977e3b10a2.tar.bz2 |
complex (complex<float>::real, [...]): Declare as const member functions.
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.
From-SVN: r198141
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/include/std/complex | 12 | ||||
-rw-r--r-- | libstdc++-v3/include/std/type_traits | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fdf739f..ff95635 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,15 @@ 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 * include/bits/stl_heap.h (pop_heap): Avoid self move-assignment. * testsuite/25_algorithms/pop_heap/57010.cc: New. diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex index e426673..b31e8b1 100644 --- a/libstdc++-v3/include/std/complex +++ b/libstdc++-v3/include/std/complex @@ -1066,11 +1066,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 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; } @@ -1217,11 +1217,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 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; } @@ -1369,11 +1369,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // 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; } diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 488ffd9..5bff0ab 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -59,7 +59,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION 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> |