220 37375 <CANiq72khnVdSaUapRcgb3fHZotYntSs99uC3a9fBc+KJWOO0HA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Pointer overload for ||
Date: Sat, 17 Mar 2018 05:38:52 +0100
Lines: 51
Approved: news@gmane.org
Message-ID: <CANiq72khnVdSaUapRcgb3fHZotYntSs99uC3a9fBc+KJWOO0HA@mail.gmail.com>
References: <1fea07df-46a6-4df2-865a-849be8f8d129@isocpp.org>
 <CANiq72kL7HQf2oS5THm8bxzurhzoc7uhNQq3S9+zvBce2yMZZQ@mail.gmail.com>
 <c7cd5d95-0031-4e50-b7a1-9adcff695bd2@isocpp.org> <CALvx3hYz84MdBu_WsixPmWf8N=9FY4BiqOv+Lon21nF2m_f0Ow@mail.gmail.com>
 <CALvx3hbrrb6tJJYEG7S9q1YrRWSXXi+OCW9n1siXRfFjjxTDYA@mail.gmail.com>
 <CANiq72kNstxnyLTCOBfNorEiyudTijCAUHwH4DsoT14WqcNs4w@mail.gmail.com> <CAANG=kWjgCt-+pKOwWk6BgwNZ9ZECd9twWwq_FC1f3WPEiNw=A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1521261432 2968 195.159.176.226 (17 Mar 2018 04:37:12 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 17 Mar 2018 04:37:12 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDRZHGH43YJRB4NXWLKQKGQEJ6FZTPI@isocpp.org Sat Mar 17 05:37:08 2018
Return-path: <std-proposals+bncBDRZHGH43YJRB4NXWLKQKGQEJ6FZTPI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f198.google.com ([209.85.220.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDRZHGH43YJRB4NXWLKQKGQEJ6FZTPI@isocpp.org>)
	id 1ex3ad-0000g2-I0
	for gclcip-std-proposals@m.gmane.org; Sat, 17 Mar 2018 05:37:07 +0100
Original-Received: by mail-qk0-f198.google.com with SMTP id a22sf7985591qkc.1
        for <gclcip-std-proposals@m.gmane.org>; Fri, 16 Mar 2018 21:39:15 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1521261554; cv=pass;
        d=google.com; s=arc-20160816;
        b=rbO3b91DuMspDNM08bwHJkfNyE6oD5i/OAOHK7mJdqBmUV0V8irGAa9I3dyM/Q9/K5
         mX02U3aHtNLO8aRvl8F0qxgR7l/LUO0JSWmNRNscQVPqLyw/PdQO4XBESbyGwvA82pB1
         CpabqjoZHR+fHTY1XRC+cJ/gPTQZtk9IHIE5sXE6xJFvFXXPJO53rGaFH3yOfEaMHRmy
         eCqtvNH4xyDbFTSS68bFF4ddboBX6hiwfGB8brtxi7JQWyH9Ln+Jf7VxymB8wcGg9Tak
         aRI1XCE75kEvmND1Q2PaU+qq5DbX3jEfikxNJcbgiYnDTdI99XtDMVDKN9Eja70bkCqn
         i9xA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-transfer-encoding
         :to:subject:message-id:date:from:references:in-reply-to:mime-version
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=ApOPO30UVCK49OSZyWWPwR6plf+Knsj9G3H1wdhupX8=;
        b=E+RHYC+3D95NlUwbzjO03L7l3brTBMOPwJjjOTqsPbUnPhTwx4IlZnlxfQnruo4JQx
         ZrYLmuh/UC010O0dVYSeTYNIsz49h/4LpdmR6EoomsMFu5nGTrZ0iIe7NlusYKF5sxhC
         T0Sw0nYqnMkESq+wrNkwErCWioIDLtWXBYFoeIneR9yff/0XcOOYDMHukugC4mCFLe5f
         wTz/UHOeuFT09AYyJ9/jiXL/e07/HBfS8cQ+qIR/gN9S+4FzYU0opJrPzXnWFzbPk0aA
         anHcPit0+GPuCxNEc5CWwWAw410vBzQsrHanc4qabCeHrL/zS8E/5Xu5Vj4Z6vqNuA8y
         WsDg==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=a7ArFmnH;
       spf=pass (google.com: domain of miguel.ojeda.sandonis@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=miguel.ojeda.sandonis@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-transfer-encoding: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=ApOPO30UVCK49OSZyWWPwR6plf+Knsj9G3H1wdhupX8=;
        b=sEii9/OKLychPrElV+xQQvrAagAh75AfoXZlg82QRvYSqK9+23MDj7+LWNQqjY+bi/
         E51L98Nv4D+Jsh/puqGTPHD0uHWze8VZItQdCql+tp93lc4385F8huFsUE36YjYuaOuO
         RN37kQ1z0lMIlATLsuonguobQ5eSERWavcyTfMo3tA1teuZWfA6bsjkaURZ6/zFBAxQD
         TSqEybFARlSqYbg/2CQQdTEaYEzLYoy15+aij/JRU/tRTWme9/2BvugYth69fS+BuCgJ
         q+7Xydfob+MFxgtXytbBNEbXyD52bXMGVEhj1ZBytahZFwGu2ESx9aKvGnQHP8+bYBgw
         9N/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:content-transfer-encoding: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=ApOPO30UVCK49OSZyWWPwR6plf+Knsj9G3H1wdhupX8=;
        b=Ti9b+cLJ82j0TWLAM1wa59GFDYBPU2a3Bx16inyYLlWu3yKp6fgQQEDfDcR3tzOGzC
         Vj+49hmQky9uuRP2BKLt+kJLLiy+pKo6/JtCcnoQC1fBBfOKwAcwQt1eKYMOiB0upQ/H
         sd6cj3rueGmObYZplUqXFVlkLVSRyQEsQAELDqrqoRnjOtuAbelej41r/nkMYVsdFZX0
         pBQrT8V61cgZk3+QqhoJgc13jI2riI+oQf8kVFXkCv5dkSKA4lWPI4CvK+kbLnLLKdj/
         DFzH479XqDgxCX2gH7B2NOMpoctM4wx8/X5mvzEZw5+uNcP7NITx2mHtd5u9aEG7RKKQ
         B/3 
X-Gm-Message-State: AElRT7ESpbtjO9m1+JKmJNznMSgSpxRv8kxgSrp2bgl1goWV4BZgVh/6
	uY/C6Wj5P819QnkKSnh4hdn6+A==
X-Google-Smtp-Source: AG47ELs0++2BUtoacZIj8njUwvJMjoEpzIae8A6bA8bRvMURvkgolFjvRaq34HtUOnkWBQoSO5salA==
X-Received: by 10.200.46.119 with SMTP id s52mr2837045qta.32.1521261554418;
        Fri, 16 Mar 2018 21:39:14 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.55.77.8 with SMTP id a8ls5242365qkb.3.gmail; Fri, 16 Mar 2018
 21:39:13 -0700 (PDT)
X-Received: by 10.55.46.194 with SMTP id u185mr6345253qkh.63.1521261553649;
        Fri, 16 Mar 2018 21:39:13 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1521261553; cv=none;
        d=google.com; s=arc-20160816;
        b=ZnQrIoy+mVfjLeoJNaShgpiqxFMoavssXIs/Vn3DF1szPtKrSDptamMsL0Z9HwiasP
         UYelKurqDKJ2+447B5EGAeZK2mrdbSwrSVXVjZUNUeyaHpQ7zjcF4n0p7PPUajqq5L+A
         CzOSi4QKMoz69G1agKRLaSOPFMoZ+0sSMMs0ryTNWrtc60HunkAIBjKZ0nm+HmtvjSWU
         W/gDCV2uOcL0yLEK7iE2ShshEzGpuU7aDs1eResMozARQ7Rhwy+3aD7RJXxniVMUnWr8
         /3G2ZStAo/fOr4bGvtJrDVWQ/IjTMufHMDOQdPOxb0tt5IqxLWILS7cOYNNRivc8OSD3
         2nag==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:to:subject:message-id:date:from
         :references:in-reply-to:mime-version:dkim-signature
         :arc-authentication-results;
        bh=vVI9WgIFyNQ7gR184XvI2ros4PtR590e3Fv/AtuRN3E=;
        b=JB8G2t8qtuXsZZ7QZEm+EuQAMrBCFJS2gP7nC6XxibHCfnv03KgPmsNzxw7b1WwHV/
         gHWCeYdQ63Jycvgp00QIbAYD7rt6u+oeG5iom8RJe2ekwUAj6XAwm9gg7HpOayvz0oVD
         iQFx/zmfWszHk0LRVFvNDpfK31CVaYMjNV9TXTx1BL6DwaIsPBH3CA6w9+PG2VevYpF9
         devB7KBVqCcROZmdlHODgj0VyU5zxdhUynsvJGs3SAYtKFhgw2dLH/QLMO/0aQXIrYee
         hL69KRGKcd/eCjqVmsZs0rtqOL33oERdp7LIwbGP/CXcOOgIoPJqkCkePDggTp19J6KC
         dR0g==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=a7ArFmnH;
       spf=pass (google.com: domain of miguel.ojeda.sandonis@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=miguel.ojeda.sandonis@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id m50sor5850901qtm.90.2018.03.16.21.39.13
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Fri, 16 Mar 2018 21:39:13 -0700 (PDT)
Received-SPF: pass (google.com: domain of miguel.ojeda.sandonis@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.237.36.167 with SMTP id t36mr6778175qtc.136.1521261553183;
 Fri, 16 Mar 2018 21:39:13 -0700 (PDT)
Original-Received: by 10.200.52.227 with HTTP; Fri, 16 Mar 2018 21:38:52 -0700 (PDT)
In-Reply-To: <CAANG=kWjgCt-+pKOwWk6BgwNZ9ZECd9twWwq_FC1f3WPEiNw=A@mail.gmail.com>
X-Original-Sender: miguel.ojeda.sandonis@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=a7ArFmnH;       spf=pass
 (google.com: domain of miguel.ojeda.sandonis@gmail.com designates
 209.85.220.41 as permitted sender) smtp.mailfrom=miguel.ojeda.sandonis@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE 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: <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:37375
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37375>

On Tue, Mar 13, 2018 at 12:26 PM, Ga=C5=A1per A=C5=BEman <gasper.azman@gmai=
l.com> wrote:
> But my point was we *already have* an operator with the exact semantics o=
f
> the macro above - it's just a gnu extension. We could just propose that!
>
> https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html
>
> x =3D x?:new int;
>
> It's unambiguous, it's obvious it's a conditional, it's a one-liner, and

The question is: what do you gain by introducing it? Clarity? I am not
convinced it is simpler than the alternatives. Expressiveness? You can
already do the same in roughly the same amount of code (and also "in
one line" as well).

Moreover, for complex types, this:

  if (x) x =3D y;

can potentially be much better, because the assignment is only done in one =
case.

> more importantly, it can be used for way more than just pointers. Oh, and=
 we
> have implementations and knowledge of how it behaves, and it's also not a
> weird new form of || or |.

What "new forms"? They are just overloads, and adding new operators is
about as confusing as operator overloading. In both cases, you end up
having to memorize yet another idiom that people will use in some --
but not all -- projects.

In addition, ||, | and |=3D can currently be used for anything as well,
not just pointers. This is not the same as saying that they *should*,
but it is not an advantage of ?: either.

Cheers,
Miguel

--=20
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 e=
mail 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/CANiq72khnVdSaUapRcgb3fHZotYntSs99uC3a9fBc%2BKJW=
OO0HA%40mail.gmail.com.

.
