220 20694 <2242837.lDbo80ytWE@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Null -conditional and -coalescing operators
Date: Tue, 22 Sep 2015 23:06:53 -0700
Lines: 39
Approved: news@gmane.org
Message-ID: <2242837.lDbo80ytWE@tjmaciei-mobl4>
References: <4c3e2ee7-2159-4e93-a439-7d5c94c38c9c@isocpp.org> <6a0ad653-4764-483b-afb5-74d444be15d9@isocpp.org> <09547076-d049-4d87-acc3-b851e6518942@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1442988433 19472 80.91.229.3 (23 Sep 2015 06:07:13 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 23 Sep 2015 06:07:13 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBAEDRGYAKGQETR6ZZYA@isocpp.org Wed Sep 23 08:07:00 2015
Return-path: <std-proposals+bncBCB4TK757YBRBAEDRGYAKGQETR6ZZYA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f200.google.com ([209.85.212.200])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBAEDRGYAKGQETR6ZZYA@isocpp.org>)
	id 1ZedCk-0006Na-CN
	for gclcip-std-proposals@m.gmane.org; Wed, 23 Sep 2015 08:06:58 +0200
Original-Received: by wicgb1 with SMTP id gb1sf18756246wic.3
        for <gclcip-std-proposals@m.gmane.org>; Tue, 22 Sep 2015 23:06:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=v8TbP3xyZimhSForhEI0poOjtbnLnjHLeTyxKA4tqAc=;
        b=AxagufjsT/zQiXDRGwKOpfdITMhlUgYrKxVRZ/WBZtX823Izp85Gbe9/RrMvLS64sJ
         epTf3IL2YTr/RwvDoeqz4kyk3occZxwFgSMbTobgInWbQMHnLNw6c+cOmPUOwkYdw4tA
         8oSIRjeDHcScp3QgaDzTmwk7wPQhHPpfgqK3bc6bzirxuUklOhEE4Ab4ObF8+IIVMj//
         F8ynBq+PWuzoNGzSO1VT2hv3GD/w+u2MXA2hLbE+ZGqJ8FCKtsWaf0H/0rEKmRsE0Qbf
         CdPh//zvcIaicX8EfnJLp0CtMwTV65Hmj1v0J1DClqEfqBrHIlMUqCY1Opex4HmnKtpk
         7PSQ= 
X-Gm-Message-State: ALoCoQmzZk2xBsjHBiwGdDlcU73hzwy9+h2awfxGK+bv13WrX+xWH9dwi8m3M5AuJRNx5ZSCDod9
X-Received: by 10.181.29.103 with SMTP id jv7mr265851wid.0.1442988417408;
        Tue, 22 Sep 2015 23:06:57 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.86.39 with SMTP id m7ls248371wiz.23.gmail; Tue, 22 Sep
 2015 23:06:56 -0700 (PDT)
X-Received: by 10.180.107.130 with SMTP id hc2mr1694609wib.92.1442988416069;
        Tue, 22 Sep 2015 23:06:56 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id dj1si7280278wjc.70.2015.09.22.23.06.55
        for <std-proposals@isocpp.org>;
        Tue, 22 Sep 2015 23:06:55 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl4.localnet (unknown [IPv6:2601:1c0:5803:81c9:e16a:f933:34c6:6d])
	by gondolin.macieira.info (Postfix) with ESMTPSA id 7302711B4C5
	for <std-proposals@isocpp.org>; Tue, 22 Sep 2015 23:06:55 -0700 (PDT)
User-Agent: KMail/4.14.9 (Linux/4.1.6-1-desktop; KDE/4.14.9; x86_64; ; )
In-Reply-To: <09547076-d049-4d87-acc3-b851e6518942@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://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>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:20694
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20694>

On Tuesday 22 September 2015 10:38:58 joewoodbury@gmail.com wrote:
> Thus if I wrote
> 
> int val = connection ?: 5;
> 
> your solution wouldn't work.

Assuming that connection was a pointer here, you'd get an error about 
assigning a pointer to an integer.

The ?: syntax with the missing second operand already has a precedent to mean 
a repeat of the first operand. Therefore, the above reads:

int val = connection ? connection : 5;

However, I would like to see the syntax standardised. When you're dealing with 
C code that returns error conditions, this is useful:

	ErrorCode err = some_function();
	err = err ?: some_other_function();
	err = err ?: some_third_function();

I'm not going to ask for, but it would be nice to have

	err ?:= some_function();
-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
