summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-29 16:28:19 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-08-29 16:28:19 +0000
commitc44802ee4f22bbb6127328794b19a9df0353da6d (patch)
tree4fd1334cf972596054373224ea909f5e7f663976
parentf0fbe519e07e1ae1d850785496222f7c01d0a38b (diff)
downloadgcc-c44802ee4f22bbb6127328794b19a9df0353da6d.tar.gz
* include/std/complex (complex): Define copy constructor and
assignment operator as defaulted. Improve Doxygen comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214736 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/std/complex39
2 files changed, 27 insertions, 17 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 83a2f17487c..cc6659539d5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-29 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/complex (complex): Define copy constructor and
+ assignment operator as defaulted. Improve Doxygen comments.
+
2014-08-28 Jonathan Wakely <jwakely@redhat.com>
* testsuite/ext/random/*: Fix incorrect standard references in
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 1ae6c4580c7..f6d1de5d47e 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -129,9 +129,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
: _M_real(__r), _M_imag(__i) { }
- // Lets the compiler synthesize the copy constructor
- // complex (const complex<_Tp>&);
- /// Copy constructor.
+ // Let the compiler synthesize the copy constructor
+#if __cplusplus >= 201103L
+ constexpr complex(const complex&) = default;
+#endif
+
+ /// Converting constructor.
template<typename _Up>
_GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z)
: _M_real(__z.real()), _M_imag(__z.imag()) { }
@@ -172,10 +175,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void
imag(_Tp __val) { _M_imag = __val; }
- /// Assign this complex number to scalar @a t.
+ /// Assign a scalar to this complex number.
complex<_Tp>& operator=(const _Tp&);
- /// Add @a t to this complex number.
+ /// Add a scalar to this complex number.
// 26.2.5/1
complex<_Tp>&
operator+=(const _Tp& __t)
@@ -184,7 +187,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return *this;
}
- /// Subtract @a t from this complex number.
+ /// Subtract a scalar from this complex number.
// 26.2.5/3
complex<_Tp>&
operator-=(const _Tp& __t)
@@ -193,27 +196,29 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return *this;
}
- /// Multiply this complex number by @a t.
+ /// Multiply this complex number by a scalar.
complex<_Tp>& operator*=(const _Tp&);
- /// Divide this complex number by @a t.
+ /// Divide this complex number by a scalar.
complex<_Tp>& operator/=(const _Tp&);
- // Lets the compiler synthesize the
- // copy and assignment operator
- // complex<_Tp>& operator= (const complex<_Tp>&);
- /// Assign this complex number to complex @a z.
+ // Let the compiler synthesize the copy assignment operator
+#if __cplusplus >= 201103L
+ complex& operator=(const complex&) = default;
+#endif
+
+ /// Assign another complex number to this one.
template<typename _Up>
complex<_Tp>& operator=(const complex<_Up>&);
- /// Add @a z to this complex number.
+ /// Add another complex number to this one.
template<typename _Up>
complex<_Tp>& operator+=(const complex<_Up>&);
- /// Subtract @a z from this complex number.
+ /// Subtract another complex number from this one.
template<typename _Up>
complex<_Tp>& operator-=(const complex<_Up>&);
- /// Multiply this complex number by @a z.
+ /// Multiply this complex number by another.
template<typename _Up>
complex<_Tp>& operator*=(const complex<_Up>&);
- /// Divide this complex number by @a z.
+ /// Divide this complex number by another.
template<typename _Up>
complex<_Tp>& operator/=(const complex<_Up>&);
@@ -625,7 +630,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// 26.2.7/5: norm(__z) returns the squared magnitude of __z.
// As defined, norm() is -not- a norm is the common mathematical
- // sens used in numerics. The helper class _Norm_helper<> tries to
+ // sense used in numerics. The helper class _Norm_helper<> tries to
// distinguish between builtin floating point and the rest, so as
// to deliver an answer as close as possible to the real value.
template<bool>