220 20628 <CAFk2RUZjdykvdW8DuAcnY=MQs6HUFc91H6FO57xtGJ_aSvxfVw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Null -conditional and -coalescing operators
Date: Tue, 22 Sep 2015 20:32:28 +0300
Lines: 31
Approved: news@gmane.org
Message-ID: <CAFk2RUZjdykvdW8DuAcnY=MQs6HUFc91H6FO57xtGJ_aSvxfVw@mail.gmail.com>
References: <4c3e2ee7-2159-4e93-a439-7d5c94c38c9c@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 1442943153 29279 80.91.229.3 (22 Sep 2015 17:32:33 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 22 Sep 2015 17:32:33 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBLFBQ2YAKGQEZP7A4ZA@isocpp.org Tue Sep 22 19:32:32 2015
Return-path: <std-proposals+bncBC5JHI7A7ALRBLFBQ2YAKGQEZP7A4ZA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ob0-f199.google.com ([209.85.214.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBLFBQ2YAKGQEZP7A4ZA@isocpp.org>)
	id 1ZeRQd-0001xI-1H
	for gclcip-std-proposals@m.gmane.org; Tue, 22 Sep 2015 19:32:31 +0200
Original-Received: by obbbh8 with SMTP id bh8sf21683514obb.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 22 Sep 2015 10:32:29 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to: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=hBvXEe5FBWY8MNKj7l4UY9DfFnAsvI3zMnxuim0CtgY=;
        b=Qtuoawip7gZ+uBUtSxs8+UAFNN0sfJowYCLy4SeOTU7w7Ip8uxe9Un6KJSiV+ULtwr
         J8Oum2eKc8wEpJcgSHFSahMZncmsFZeY5rIa6tNd8woTkqAKFpxb5Pap6p0ddfvmFt3U
         kRHH/+OrYgxKGF848+JCjhRm6PEW3pSQg1m0mzeZHnaHo6nNheHtM0Uq/2wGAQuymgpA
         2jp72GYQDoRD2MSdiHmc0zaDbQ4SuV64Mm1IbeRaLOxZtsMeTq0dYczUH9Wsx4dm8PB0
         lRT6afYhAsUgB2eyjJvKYTiBolM43YlH9GomLD50FAIpRiz4RRdhiT8ptEtT46MnAU+z
         GGMw==
X-Gm-Message-State: ALoCoQmgLl1rvzpLPNrWBM8PfS8NV84pmDeUASze71+l9LJuMxNvdLSaMoEGt3khNOilEftbq9BP
X-Received: by 10.107.136.229 with SMTP id s98mr27677200ioi.34.1442943149874;
        Tue, 22 Sep 2015 10:32:29 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.20.214 with SMTP id 80ls3151234qgj.64.gmail; Tue, 22 Sep
 2015 10:32:28 -0700 (PDT)
X-Received: by 10.31.15.66 with SMTP id 63mr18956604vkp.147.1442943148587;
        Tue, 22 Sep 2015 10:32:28 -0700 (PDT)
Original-Received: from mail-vk0-x22e.google.com (mail-vk0-x22e.google.com. [2607:f8b0:400c:c05::22e])
        by mx.google.com with ESMTPS id l140si2147840vkd.81.2015.09.22.10.32.28
        for <std-proposals@isocpp.org>
        (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 22 Sep 2015 10:32:28 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::22e as permitted sender) client-ip=2607:f8b0:400c:c05::22e;
Original-Received: by vkhf67 with SMTP id f67so11371135vkh.1
        for <std-proposals@isocpp.org>; Tue, 22 Sep 2015 10:32:28 -0700 (PDT)
X-Received: by 10.31.185.198 with SMTP id j189mr18415957vkf.34.1442943148406;
 Tue, 22 Sep 2015 10:32:28 -0700 (PDT)
Original-Received: by 10.103.37.195 with HTTP; Tue, 22 Sep 2015 10:32:28 -0700 (PDT)
In-Reply-To: <4c3e2ee7-2159-4e93-a439-7d5c94c38c9c@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400c:c05::22e as
 permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (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-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:20628
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/20628>

On 22 September 2015 at 20:03,  <joewoodbury@gmail.com> wrote:
> Checking for null and then doing one thing is a common task.
> null-conditional and null-coalescing operators would be a nice solution.
>
> For example, given the following pointer:
>
>     unique_ptr<Connection> connection;
>
> This may happen:
>
>     if (connection)
>     {
>         connection->sendMessage(msg);
>     }
>
> A nice alternative would be:
>
>     connection ?: connection->SendMessage(msg);


This was proposed and rejected, see
http://cplusplus.github.io/EWG/ewg-closed.html#138

-- 

--- 
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/.

.
