220 32562 <b75d4532-bb6e-4b66-8f9b-a2a94b679e96@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: ma.kalbfuss@web.de
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: relaxing rules for ternary operator. Allow
 incompatible types.
Date: Sun, 21 May 2017 13:54:51 -0700 (PDT)
Lines: 110
Approved: news@gmane.org
Message-ID: <b75d4532-bb6e-4b66-8f9b-a2a94b679e96@isocpp.org>
References: <1b5ee8eb-53df-4e98-af2f-829c7bc2e5b2@isocpp.org> <99350a9e-0c6b-468d-9761-f2b2b052275e@isocpp.org> <27694795.c6R7qxKFE5@tjmaciei-mobl1>
 <1678895.0nQhqNqFQE@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2482_558607628.1495400092089"
X-Trace: blaine.gmane.org 1495400096 11664 195.159.176.226 (21 May 2017 20:54:56 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 21 May 2017 20:54:56 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC7YTI72XQOBBHH5Q7EQKGQEVRZUF7I@isocpp.org Sun May 21 22:54:50 2017
Return-path: <std-proposals+bncBC7YTI72XQOBBHH5Q7EQKGQEVRZUF7I@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f198.google.com ([209.85.217.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC7YTI72XQOBBHH5Q7EQKGQEVRZUF7I@isocpp.org>)
	id 1dCXsH-0002qK-Kg
	for gclcip-std-proposals@m.gmane.org; Sun, 21 May 2017 22:54:50 +0200
Original-Received: by mail-ua0-f198.google.com with SMTP id w13sf28768995uaw.11
        for <gclcip-std-proposals@m.gmane.org>; Sun, 21 May 2017 13:54:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=H6N7w25Os0wcF5z4NOb1rD6YqueH/04Hc4NjjQv8jEM=;
        b=pToICQWVLcoPGDdx0snN3qI19gF6xXK/2CWm2EMUQXEUZzZzSgJPC/wHRVZHpXANOO
         AlpfumzqLbdSvTCLIljpy8Z2Db90wARtSsC4oFavB0/JJDnHGX8iYy0VzmPg7wKCtubV
         oxlrqwyfV3aWOgwRu++GrAve1el2HTwqhTtbYB4zYmI3zD1xfLir3nUUdfBemnYrnBp3
         iBXL0pxO+V82le3rIerTXMDoFEBYaMwQHcKU/UTy2PcJVHFlKAY6m/8/GrlIsA6Fgxnx
         bt5ReX9wgMs1nQKjwB9w0bmGs2+J1Sv0KZgDdXHM8A6Q/3F7ITTJys71SpSCdbELgPzJ
         4caw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=H6N7w25Os0wcF5z4NOb1rD6YqueH/04Hc4NjjQv8jEM=;
        b=JADmv9b8eIKZhp9/5KBLocT8G2pBsKR7pnMoG0nCeOC041jRndQzABpRFmBTQvDfCt
         halvqZEGEqGO41co7++TOy62qMOE4k04Gk2pw4E3ITjl2FmieL4JVznDnZh9Gx7H8Q2y
         a/OpEwFVVmdaSgUxjQEA0xGntMkXJYyBoe6wj5P++jZKo8yODJXuqUpnBoNFOioZTJOu
         meqaWColP1v6bpjSolCgyBTKbH3S16EodaxWDeyqXktKF86REB2HsYv5Cfydy3ahZUE8
         k80NYmYOXteZLMwd8A3/ySRzFr3yYiRdp1AIvl8Ka5+lcDbcvv/bRLzo2cs1o1woLpq6
         YF/g==
X-Gm-Message-State: AODbwcDZRRvxQQ6hActQgba4/xyylRbHAF8Gqky8kOvDK72Ye4Xg+/o3
	XeLMDMSpzHoMowW+
X-Received: by 10.31.128.74 with SMTP id b71mr5681333vkd.16.1495400093580;
        Sun, 21 May 2017 13:54:53 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.68.164 with SMTP id v36ls2474826ote.28.gmail; Sun, 21 May
 2017 13:54:52 -0700 (PDT)
X-Received: by 10.157.45.79 with SMTP id v73mr419767ota.20.1495400092729;
        Sun, 21 May 2017 13:54:52 -0700 (PDT)
In-Reply-To: <1678895.0nQhqNqFQE@tjmaciei-mobl1>
X-Original-Sender: ma.kalbfuss@web.de
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:32562
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32562>

------=_Part_2482_558607628.1495400092089
Content-Type: multipart/alternative; 
	boundary="----=_Part_2483_121770391.1495400092089"

------=_Part_2483_121770391.1495400092089
Content-Type: text/plain; charset="UTF-8"

Yeah, i realize that. This is something you have to consider if you're 
using templates extensively. This is not the right solution for everything. 
I think in most cases, you use one or at most two ternary operators in one 
place. For three or more ternary operators the runtime overhead is 
assumably the lesser of two evils. But even if it grows exponentially, the 
constants are pretty small. Normaly only a few instructions are involved.

Am Sonntag, 21. Mai 2017 19:17:03 UTC+2 schrieb Thiago Macieira:
>
> On domingo, 21 de maio de 2017 10:08:16 PDT Thiago Macieira wrote: 
> > You do realise this grows exponentially, right? 
> > 
> >         auto x = runtime_condition ? A{} : B{}; 
> >         auto y = runtime_condition ? C{} : D{}; 
> >         auto z = runtime_condition ? E{} : F{}; 
>
> I mean different runtime conditions here. 
>
> >         x.f() + y.f() + z.f(); 
> > 
> > There are 8 different branches there to make the above work. 
>
>
> -- 
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org 
>    Software Architect - Intel Open Source Technology Center 
>
>

-- 
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/b75d4532-bb6e-4b66-8f9b-a2a94b679e96%40isocpp.org.

------=_Part_2483_121770391.1495400092089
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yeah, i realize that. This is something you have to consid=
er if you&#39;re using templates extensively. This is not the right solutio=
n for everything. I think in most cases, you use one or at most two ternary=
 operators in one place. For three or more ternary operators the runtime ov=
erhead is assumably the lesser of two evils. But even if it grows exponenti=
ally, the constants are pretty small. Normaly only a few instructions are i=
nvolved.<br><br>Am Sonntag, 21. Mai 2017 19:17:03 UTC+2 schrieb Thiago Maci=
eira:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;">On domingo, 21 de maio de=
 2017 10:08:16 PDT Thiago Macieira wrote:
<br>&gt; You do realise this grows exponentially, right?
<br>&gt;=20
<br>&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto x =3D runtime_condition ? A{} : B=
{};
<br>&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto y =3D runtime_condition ? C{} : D=
{};
<br>&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 auto z =3D runtime_condition ? E{} : F=
{};
<br>
<br>I mean different runtime conditions here.
<br>
<br>&gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0 x.f() + y.f() + z.f();
<br>&gt;=20
<br>&gt; There are 8 different branches there to make the above work.
<br>
<br>
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x=
3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return t=
rue;">macieira.info</a> - thiago (AT) <a href=3D"http://kde.org" target=3D"=
_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.=
com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH=
GRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;">kde.org</a=
>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/b75d4532-bb6e-4b66-8f9b-a2a94b679e96%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/b75d4532-bb6e-4b66-8f9b-a2a94b679e96=
%40isocpp.org</a>.<br />

------=_Part_2483_121770391.1495400092089--

------=_Part_2482_558607628.1495400092089--

.
