[Bug libstdc++/51013] complex::{imag,real}() should maintain lvalue-returning extension in C++11

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 8 00:11:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51013

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-11-08 00:05:20 UTC ---
(In reply to comment #2)
> Isn't the const redundant here?

Maybe, the code predates constexpr.

> Actually, I only see constexpr for the specializations in the standard, not for
>the general case, am I looking at the wrong place?

The constexpr are there, in the primary too, around line # 150.

> Why can't you still have these overloads?
> constexpr _Tp real(); // const
> _Tp&real();
> 
> Note that I am not taking position on whether it should be added, I am just
> confused by the technical reasons.

Sure you can, in principle. The mathematical/physical concept of beauty from
symmetry prevents me for posting such patch, now and ever ;)



More information about the Gcc-bugs mailing list