220 28432 <ns10ek$7ip$1@blaine.gmane.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Matthew Woehlke <mwoehlke.floss@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Something is better then nothing: Please, relax
 Initializer List use with operators!
Date: Thu, 22 Sep 2016 12:21:42 -0400
Lines: 45
Approved: news@gmane.org
Message-ID: <ns10ek$7ip$1@blaine.gmane.org>
References: <0892f743-bca2-4f18-b023-d4a57cea60fb@isocpp.org>
 <0e27bc76-eada-4d70-80d7-b91b5a2d5767@isocpp.org>
 <nrru5o$sa6$1@blaine.gmane.org>
 <c2ea03cf-ed7a-4649-b7c9-66e5d8936d07@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: blaine.gmane.org 1475070203 1890 195.159.176.226 (28 Sep 2016 13:43:23 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 28 Sep 2016 13:43:23 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.1.0
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC37LBFWUIFBBZMRV67QKGQERRPJGGA@isocpp.org Wed Sep 28 15:43:17 2016
Return-path: <std-proposals+bncBC37LBFWUIFBBZMRV67QKGQERRPJGGA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qt0-f200.google.com ([209.85.216.200])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC37LBFWUIFBBZMRV67QKGQERRPJGGA@isocpp.org>)
	id 1bpF8W-0006FL-Et
	for gclcip-std-proposals@m.gmane.org; Wed, 28 Sep 2016 15:43:00 +0200
Original-Received: by mail-qt0-f200.google.com with SMTP id 16sf55499004qtn.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 28 Sep 2016 06:43:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=to:from:subject:date:lines:message-id:references:mime-version
         :user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=gWhwLPBYcBGTM4E6lUJit18QFbPalWJQjWNAEi9bUsE=;
        b=Btgk8BHfXOrNE9ixFrWe+BPlNFqs7bDvTgqFjXcNLZBTibBH3cfqFnSa2Hv6GJq4fi
         wfn2yeQzeozsSerFtuA+BjCNFIPkWCyGyI/LzUTmZSP72GV14QQr3jbtpcK1UutFJbAh
         CtBJ2Ozux7abkzBLoSurRnWxolAzVGFO2GQ2zhuVWn1WUiupVmwBFQizLITJvXIk5s0m
         BPATr22nKGcBucLth9NXuf4KHG93kwmvRWry4iNVrpJ3zhP3aQvd7TKH4ekiMnCBfXyv
         bbXOgKm3Bq9y2/k33Yksv+dG3OsgmVq+B5ybjwZZfKnMxtpC/pSVnyA2oHAsN89nY8tm
         trmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=gWhwLPBYcBGTM4E6lUJit18QFbPalWJQjWNAEi9bUsE=;
        b=Tues/ITZ6QenWOYZDW66f0qIGjfXjBBdLEoHj+nK8FgBLzdJVMD6vzbS3999PSJWG+
         V868mpChzj5DFWjDD+H3GzaviwK/DLTt+NmdWfparFpRZSjlVFGjqdu5FyQ+ivIdAtRZ
         P7N0nP2czJfxAwyRi6rRHxdfaLWEGskHOGkf1hc++Jeclc3lNOnOGppe3dabskfGHcsF
         eMiOuPCnKT7S2r9lw+yfgu4r9bXG5078OY2e+zMBRkwUo8hyp2KTfc2J5dupRvOecOyb
         MO8KivJ5qLTevsPL8iarTrRIOoZs2xh07+g0Uisn+RGvqsqwopqquosrxpIG7+GnWcMr
         Oywg==
X-Gm-Message-State: AA6/9RnQWCuZTj9f6QjsEJbwpmpouoFUohmrg/nfNw6qBPSy4FvWzAVhOIgp1VrEBXd+pg==
X-Received: by 10.200.35.252 with SMTP id r57mr8331678qtr.30.1475070182032;
        Wed, 28 Sep 2016 06:43:02 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.20.68 with SMTP id h62ls923484oth.17.gmail; Wed, 28 Sep
 2016 06:43:01 -0700 (PDT)
X-Received: by 10.13.255.67 with SMTP id p64mr8941844ywf.137.1475070181094;
        Wed, 28 Sep 2016 06:43:01 -0700 (PDT)
Original-Received: by 10.55.9.211 with SMTP id 202msqkj;
        Thu, 22 Sep 2016 09:22:03 -0700 (PDT)
X-Received: by 10.25.15.38 with SMTP id e38mr1122727lfi.24.1474561322714;
        Thu, 22 Sep 2016 09:22:02 -0700 (PDT)
Original-Received: from blaine.gmane.org ([195.159.176.226])
        by mx.google.com with ESMTPS id k82si1338589lfd.92.2016.09.22.09.22.02
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 22 Sep 2016 09:22:02 -0700 (PDT)
Received-SPF: neutral (google.com: 195.159.176.226 is neither permitted nor denied by best guess record for domain of gclcip-std-proposals@m.gmane.org) client-ip=195.159.176.226;
Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1bn6ky-0005S4-Va
	for std-proposals@isocpp.org; Thu, 22 Sep 2016 18:21:52 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 38
Original-X-Complaints-To: usenet@blaine.gmane.org
X-Enigmail-Draft-Status: N1110
In-Reply-To: <c2ea03cf-ed7a-4649-b7c9-66e5d8936d07@isocpp.org>
X-Original-Sender: mwoehlke.floss@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=neutral
 (google.com: 195.159.176.226 is neither permitted nor denied by best guess
 record for domain of gclcip-std-proposals@m.gmane.org) smtp.mailfrom=gclcip-std-proposals@m.gmane.org;
       dmarc=fail (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:28432
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/28432>

On 2016-09-21 12:57, mihailnajdenov@gmail.com wrote:
> It should be noted the {,} statement is not an std::initializer_list all by 
> itself (IIRC). It can be converted to such like in the auto list = {,};
> Also beginning a statement with { is already a new scope.

If that was the only problem, it's easily solved (again, let `@` be some
operator):

  auto{...} @ foo

....and of course it doesn't come up if the expression is in an `if()`,
or the RHS of an assignment (e.g. `auto x = {...} @ y`). So I don't
think this should kill using an initializer-list as an operand of an
expression like `x @ y`.

What *does* kill it (on the LHS) is that the left operand of `x @ y` is
what determines where `operator@` is looked up, and (at least presently)
std::initializer_list has no operators.

WHICH IS FINE!

> *But the fact it can't be used on the LHS should not forbid using it on the 
> RHS* - they are already rhs-only (were used in such context), AND are 
> mostly needed there anyway!

Exactly. I disagree with the assertion that we can't allow it on the RHS
because we can't allow it on the LHS. There is a perfectly valid and
consistent reason why it makes no sense on the LHS (see above), that is
true for *any* left operand, not just std::initializer_list.
Extrapolating from that that we should not allow it on the RHS either
does not follow.

> The perfect should not be the enemy of the good.

Agreed!

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ns10ek%247ip%241%40blaine.gmane.org.

.
