[patch] clarify confusing comments in std::complex
Jonathan Wakely
jwakely@redhat.com
Fri Aug 29 16:28:00 GMT 2014
We have confusing comments in <complex> that seem to imply that a template
(mis-labelled as the copy constructor) allows the compiler to define the
implicit copy constructor:
// Lets the compiler synthesize the copy constructor
// complex (const complex<_Tp>&);
/// Copy constructor.
template<typename _Up>
_GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z)
: _M_real(__z.real()), _M_imag(__z.imag()) { }
I think the comment should say "Let the compiler..." and should be
separate from the template following it. I'm defaulting the copy
constructor and assignment operator so it's clearer what is intended.
We also have Doxygen comments on std::complex that refer to function
parameters such as @a z that aren't named in the declaration, and the
effects of the assignment operator are documented backwards.
Tested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3905 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140829/5aabccd1/attachment.bin>
More information about the Libstdc++
mailing list