From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 94713 invoked by alias); 27 Aug 2015 19:54:29 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 94686 invoked by uid 89); 27 Aug 2015 19:54:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 27 Aug 2015 19:54:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id DAA338CF5B; Thu, 27 Aug 2015 19:54:26 +0000 (UTC) Received: from localhost (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7RJsPlB018009; Thu, 27 Aug 2015 15:54:26 -0400 Date: Thu, 27 Aug 2015 19:56:00 -0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] libstdc++/67374 declare valarray begin/end overloads in Message-ID: <20150827195425.GX2631@redhat.com> References: <20150827190516.GW2631@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2015-08/txt/msg01745.txt.bz2 On 27/08/15 21:48 +0200, Marc Glisse wrote: >On Thu, 27 Aug 2015, Jonathan Wakely wrote: > >>The std::cbegin function in can't call the >>std::begin function in unless it knows about it, so we need >>to declare the valarray overloads in . > >Hmm, do you remember why valarray has an ugly overload of std::begin >instead of a nice member function begin like every other container ? >It should at least be legal to implement it this way. No, sorry, I have no idea. C++11 added the begin non-members, and then C++14 added the cbegin non-member, which calls std::begin. I'm not convinced it's supposed to work with valarray, but it's confusing that it doesn't when std::begin(const valarray&) exists.