From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31888 invoked by alias); 7 Nov 2011 23:43:16 -0000 Received: (qmail 31875 invoked by uid 22791); 7 Nov 2011 23:43:14 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Nov 2011 23:43:01 +0000 From: "marc.glisse at normalesup dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/51013] complex::{imag,real}() should maintain lvalue-returning extension in C++11 Date: Mon, 07 Nov 2011 23:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marc.glisse at normalesup dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg00697.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51013 Marc Glisse changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marc.glisse at normalesup | |dot org --- Comment #2 from Marc Glisse 2011-11-07 23:42:46 UTC --- (In reply to comment #1) > I did *not* *remove* anything, simply, for C++11, real() and imag() are exactly > *per the letter* of the Standard, that is (similarly for the specializations): > > constexpr _Tp > real() const { return _M_real; } Isn't the const redundant here? Actually, I only see constexpr for the specializations in the standard, not for the general case, am I looking at the wrong place? > constexpr _Tp > imag() const { return _M_imag; } > > and I don't see why we should do something different. But, if Gaby thinks, > everything considered, that we want something different, I'm not going to > object to patches to that effect (from a technical point of view, note the > functions are now constexpr, thus you can't simply have two overloads anymore) 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.