220 32572 <50267964-19d0-4bb2-ba27-f018b58b8aa8@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: Mon, 22 May 2017 00:13:40 -0700 (PDT)
Lines: 1003
Approved: news@gmane.org
Message-ID: <50267964-19d0-4bb2-ba27-f018b58b8aa8@isocpp.org>
References: <1b5ee8eb-53df-4e98-af2f-829c7bc2e5b2@isocpp.org> <1678895.0nQhqNqFQE@tjmaciei-mobl1> <b75d4532-bb6e-4b66-8f9b-a2a94b679e96@isocpp.org>
 <1620864.HL4j5jKv18@tjmaciei-mobl1>
 <d14bfe0d-8c72-49a0-bf08-8041998dd125@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_2507_1148003169.1495437220471"
X-Trace: blaine.gmane.org 1495437224 13281 195.159.176.226 (22 May 2017 07:13:44 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 22 May 2017 07:13:44 +0000 (UTC)
Cc: ma.kalbfuss@web.de
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC7YTI72XQOBBJM7RLEQKGQER5AZVRI@isocpp.org Mon May 22 09:13:39 2017
Return-path: <std-proposals+bncBC7YTI72XQOBBJM7RLEQKGQER5AZVRI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f70.google.com ([209.85.218.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC7YTI72XQOBBJM7RLEQKGQER5AZVRI@isocpp.org>)
	id 1dChX7-0003HS-Ec
	for gclcip-std-proposals@m.gmane.org; Mon, 22 May 2017 09:13:38 +0200
Original-Received: by mail-oi0-f70.google.com with SMTP id d142sf157370935oib.7
        for <gclcip-std-proposals@m.gmane.org>; Mon, 22 May 2017 00:13:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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=Azbtc+U+UdOCwHg1OW9I1B9Gc38WHaqNVzQCjF/qeWU=;
        b=WkHntHGMku4yz+ahW3pqh0QU4NhwQS9MVrXvGk/KXfCzUGek97ALZcv3ek/H8o4v4t
         QXYZ8WdQffk+Cr0lxtGyTnxOb8RuGDj1Ucmpz2OmQS5PAHspn9EYq55wdQB0q9MR5L90
         OocKRrMFsgkTQO/cOLZRCEd9WWNZDhC1oxygLR/TF+0dgOeyfLAln0xYiF7m/MDf4tZ3
         voTkJYXNMVTgw89zaid3bY1aCvL5x5HioiqU4cM8rLGqhwKPpUi+I98894pX/Ph2Zdcs
         biD9ZC+BwVTczq+0+/q3Vz1qE7DrA8JVbZrzNSR5mgoIYHgh3K0BpS33fF0Aj2br/xbv
         RVow==
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:cc: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=Azbtc+U+UdOCwHg1OW9I1B9Gc38WHaqNVzQCjF/qeWU=;
        b=seN8j1+2zW2spKOIAUWyLR+joQaaszcB/tn5kem9cwaZ/dhvWDkfp9tsoj2pdC4ktC
         KKvS+mXddNKzh1zZ6mHlMjFVcnLGkLhD6iiF3opTb3Vc7yZ7xC3nmHlKomwuUgRk2u3z
         /OLPFET4OyHBhAqaqfMso6RVxxw7Vd4IMkCQBbc4BpypFv4XhgbVedZG0bRfU5cCti7I
         zb2ZqnJPhRkmZGf/NBzJmvIvEJMyK4hbgmT+M3TaCA3Dca/h5sdHqhQI4vealiIA7BpJ
         OB1HeDJQPIUYFRNpFjRdmElGJ+/Kw3aoqSg6t01Cc37wfaSkKIh1mVCxeQ2xwwjgBvTK
         5SmQ==
X-Gm-Message-State: AODbwcC3M4mjP/ZjC61ZAo7dDV4lRGshRTwiDPdyP6YvPTYLBtbODKwe
	9KMv9HPRMA6gLxsJ
X-Received: by 10.157.23.6 with SMTP id i6mr10980900ota.86.1495437222349;
        Mon, 22 May 2017 00:13:42 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.13.136 with SMTP id 8ls3057787ots.32.gmail; Mon, 22 May
 2017 00:13:41 -0700 (PDT)
X-Received: by 10.157.28.130 with SMTP id l2mr451805ota.17.1495437220987;
        Mon, 22 May 2017 00:13:40 -0700 (PDT)
In-Reply-To: <d14bfe0d-8c72-49a0-bf08-8041998dd125@isocpp.org>
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:32572
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32572>

------=_Part_2507_1148003169.1495437220471
Content-Type: multipart/alternative; 
	boundary="----=_Part_2508_366975323.1495437220473"

------=_Part_2508_366975323.1495437220473
Content-Type: text/plain; charset="UTF-8"

struct W{ int doit(){ return 1; } };
struct X{ int doit(){ return 2; } };
struct Y{ int doit(){ return 3; } };
struct Z{ int doit(){ return 4; } };


int example(bool runtime_condition1, bool runtime_condition2) {
    int result;

    if(!runtime_condition1)
        goto ternary_branch_1;

    if(!runtime_condition2)
        goto ternary_branch_2;

    result = W{}.doit() + Y{}.doit();
    goto ternary_end;
    
ternary_branch_1:

    if(!runtime_condition2);
        goto ternary_branch_3;

    result = X{}.doit() + Y{}.doit();
    goto ternary_end;

ternary_branch_2:

    result = W{}.doit() + Z{}.doit();
    goto ternary_end;

ternary_branch_3:

    result = X{}.doit() + Z{}.doit();

ternary_end:
    return result;
}



With -O0
W::doit():
        push    rbp
        mov     rbp, rsp
        mov     QWORD PTR [rbp-8], rdi
        mov     eax, 1
        pop     rbp
        ret
X::doit():
        push    rbp
        mov     rbp, rsp
        mov     QWORD PTR [rbp-8], rdi
        mov     eax, 2
        pop     rbp
        ret
Y::doit():
        push    rbp
        mov     rbp, rsp
        mov     QWORD PTR [rbp-8], rdi
        mov     eax, 3
        pop     rbp
        ret
Z::doit():
        push    rbp
        mov     rbp, rsp
        mov     QWORD PTR [rbp-8], rdi
        mov     eax, 4
        pop     rbp
        ret
example(bool, bool):
        push    rbp
        mov     rbp, rsp
        push    rbx
        sub     rsp, 40
        mov     edx, edi
        mov     eax, esi
        mov     BYTE PTR [rbp-36], dl
        mov     BYTE PTR [rbp-40], al
        movzx   eax, BYTE PTR [rbp-36]
        xor     eax, 1
        test    al, al
        jne     .L19
        movzx   eax, BYTE PTR [rbp-40]
        xor     eax, 1
        test    al, al
        jne     .L20
        lea     rax, [rbp-28]
        mov     rdi, rax
        call    W::doit()
        mov     ebx, eax
        lea     rax, [rbp-27]
        mov     rdi, rax
        call    Y::doit()
        add     eax, ebx
        mov     DWORD PTR [rbp-20], eax
        jmp     .L14
..L19:
        nop
        nop
        lea     rax, [rbp-22]
        mov     rdi, rax
        call    X::doit()
        mov     ebx, eax
        lea     rax, [rbp-21]
        mov     rdi, rax
        call    Z::doit()
        add     eax, ebx
        mov     DWORD PTR [rbp-20], eax
        jmp     .L14
..L20:
        nop
        lea     rax, [rbp-24]
        mov     rdi, rax
        call    W::doit()
        mov     ebx, eax
        lea     rax, [rbp-23]
        mov     rdi, rax
        call    Z::doit()
        add     eax, ebx
        mov     DWORD PTR [rbp-20], eax
        nop
..L14:
        mov     eax, DWORD PTR [rbp-20]
        add     rsp, 40
        pop     rbx
        pop     rbp
        ret

With -O3

example(bool, bool):
        test    dil, dil
        mov     eax, 6
        je      .L1
        xor     eax, eax
        test    sil, sil
        sete    al
        add     eax, 4
..L1:
        rep ret





Am Montag, 22. Mai 2017 08:33:33 UTC+2 schrieb ma.ka...@web.de:
>
> Sure, you don't have always exponential growth when using templates. But 
> if you simulating this case with template functions you end up having the 
> same problem.
> So I wouldn't say, that this something completely new. It is the nature of 
> the problem we try to solve. You have either runtime overhad or exponential 
> growth.
> Maybe there is a way to avoid exponential growth using optimization 
> techniques. Assumably in many cases the optimizer will reduce the amount of 
> code anyway.
> There could be a guaranteed optimization. But I'm not sure which. I will 
> build up an example, where the code isn't completely optimized away.
>
> I assume variant is an untagged union? Let's try to minimise our examples.
>
>
> Am Montag, 22. Mai 2017 02:12:20 UTC+2 schrieb Thiago Macieira:
>>
>> On domingo, 21 de maio de 2017 13:54:51 PDT ma.ka...@web.de wrote: 
>> > Yeah, i realize that. This is something you have to consider if you're 
>> > using templates extensively. 
>>
>> No, it isn't. Today, the use of templates does not imply exponential 
>> growth of 
>> generated code. 
>>
>> That is something completely new with your proposal. 
>>
>> > 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. 
>>
>> Not necessarily. Remember that you may not reevaluate the condition, so 
>> either 
>> this generates completely separate code paths (and thus the exponential 
>> expansion) or the result of the evaluation is stored in a hidden variable 
>> that 
>> is evaluated every time you access that automatic variable. 
>>
>> That is, when you write: 
>>
>>         auto x = runtime_condition1 ? A{} : B{}; 
>>         auto y = runtime_conditoin2 ? C{} : D{}; 
>>         x.f(); 
>>
>> This expands to either: 
>>
>>         if (runtime_condition1) { 
>>                 auto x = A{}; 
>>                 if (runtime_condition2) { 
>>                         auto y = C {}; 
>>                         x.f() + y.f(); 
>>                 } else { 
>>                         auto y = D {}; 
>>                         x.f() + y.f(); 
>>                 } 
>>         } else { 
>>                 auto x = B{}; 
>>                 if (runtime_condition2) { 
>>                         auto y = C {}; 
>>                         x.f() + y.f(); 
>>                 } else { 
>>                         auto y = D {}; 
>>                         x.f() + y.f(); 
>>                 } 
>>         } 
>>
>> or to: 
>>
>>         variant<A, B> x; 
>>         variant<C, D> y; 
>>         bool hidden1 = runtime_condition1; 
>>         if (hidden1) 
>>                 x.create<A>(); 
>>         else 
>>                 x.create<B>(); 
>>         bool hidden2 = runtime_condition2; 
>>         if (hidden2) 
>>                 y.create<C>(); 
>>         else 
>>                 y.create<D>(); 
>>         if (hidden1) { 
>>                 if (hidden2) 
>>                         x.as<A>().f() + y.as<C>().f(); 
>>                 else 
>>                         x.as<A>().f() + y.as<D>().f(); 
>>         } else { 
>>                 if (hidden2) 
>>                         x.as<B>().f() + y.as<C>().f(); 
>>                 else 
>>                         x.as<B>().f() + y.as<D>().f(); 
>>         } 
>>
>> -- 
>> 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/50267964-19d0-4bb2-ba27-f018b58b8aa8%40isocpp.org.

------=_Part_2508_366975323.1495437220473
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div style=3D"background-color: rgb(250, 250, 250); border=
-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflo=
w-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div=
 class=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">struct</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> W</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> doit</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(){</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">1</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">};</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> X</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettif=
y">int</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> doi=
t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(){</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">2</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">struct</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> Y</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> doit</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">(){</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">retu=
rn</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #066;" class=3D"styled-by-prettify">3</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>struct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> Z<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> doit</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">(){</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">return</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pret=
tify">4</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">};</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"> example</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">bool</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> runtime_condition1</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">=
bool</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> runti=
me_condition2</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> result</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">if</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">(!</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify">runtime_condition1</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><=
span style=3D"color: #008;" class=3D"styled-by-prettify">goto</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> ternary_branch_1</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 </sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">if</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">(!</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">runtime_condition2</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">goto</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> ternary_bra=
nch_2</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0=
 =C2=A0 result </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> W=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{}.</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">doit</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">+</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> Y</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">{}.</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify">doit</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">();</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pret=
tify">goto</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 ternary_end</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 <br>ternary_branch_1</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">if</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">(!</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify">runtime_condition2</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">goto</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> ternary_branch_3</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 result </span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> X</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">{}.</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify">doit</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">+<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> Y</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">{}.</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">doit</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">();</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">goto</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> ternary_end</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"><br><br>ternary_branch_2</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 result </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> W</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">{}.</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">doit</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">()</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">+</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> Z</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{}.</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify">doit</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">();</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">goto</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> ternary_end</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br><br>ternary_branch_3</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =C2=A0 r=
esult </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> X</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">{}.</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">doit</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">+</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> Z</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{}.</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">doit</span><span style=3D"color: #660;" class=3D"styled-by-prettify">();<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>ter=
nary_end</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">ret=
urn</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> result=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">}</span></div></code></di=
v><br><br><br>With -O0<br><div style=3D"background-color: rgb(250, 250, 250=
); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px=
; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"prettypr=
int"><div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">W</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>doit</span><span style=3D"color: #660;" class=3D"styled-by-prettify">():</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 push =C2=A0 =C2=A0rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 m=
ov =C2=A0 =C2=A0 rbp</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
> rsp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 QWORD PTR </span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">[</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">rbp</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">-</span><span style=3D"color: #066;=
" class=3D"styled-by-prettify">8</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">],</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> rdi<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 eax</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 pop =
=C2=A0 =C2=A0 rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret<br>X</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify">doit</span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">():</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 push =C2=A0 =C2=
=A0rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rbp</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> rsp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 mov =C2=A0 =C2=A0 QWORD PTR </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">-</span><span style=3D"color: #066;" class=3D"styled-by-prettify">8</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">],</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> rdi<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 mov =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pre=
ttify">2</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 pop =C2=A0 =C2=A0 rbp<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 ret<br>Y</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">do=
it</span><span style=3D"color: #660;" class=3D"styled-by-prettify">():</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 push =C2=A0 =C2=A0rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =
=C2=A0 =C2=A0 rbp</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> r=
sp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 QWORD PTR </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">[</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">rbp</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">-</span><span style=3D"color: #066;" cl=
ass=3D"styled-by-prettify">8</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">],</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> rdi<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 eax</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #066;" class=3D"styled-by-prettify">3</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 pop =C2=A0 =
=C2=A0 rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret<br>Z</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">doit</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">():</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 push =C2=A0 =C2=A0rbp<br=
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rbp</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> rsp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=
=A0 =C2=A0 QWORD PTR </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettify">-</sp=
an><span style=3D"color: #066;" class=3D"styled-by-prettify">8</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">],</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> rdi<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 mov =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">=
4</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 pop =C2=A0 =C2=A0 rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 ret<br>example</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">b=
ool</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span st=
yle=3D"color: #008;" class=3D"styled-by-prettify">bool</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">):</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 push =
=C2=A0 =C2=A0rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rbp</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> rsp<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 push =C2=A0 =C2=A0rbx<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">sub</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0 =C2=A0 rsp</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">40</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =
=C2=A0 edx</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> edi<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 eax</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> esi<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=
=A0 =C2=A0 BYTE PTR </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
>rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettify">-</spa=
n><span style=3D"color: #066;" class=3D"styled-by-prettify">36</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">],</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> dl<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 mov =C2=A0 =C2=A0 BYTE PTR </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">-</span><span style=3D"color: #066;" class=3D"styled-by-prettify">40</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">],</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> al<br>=C2=A0 =C2=A0=
 =C2=A0 =C2=A0 movzx =C2=A0 eax</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> BYTE PTR </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettify">-</s=
pan><span style=3D"color: #066;" class=3D"styled-by-prettify">36</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">]</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 xor =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify">1</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 test =C2=A0 =C2=A0al</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> al<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 jne =C2=A0 =C2=
=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">L19<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 movzx =C2=A0 eax</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> BYTE PTR </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">-</span><span style=3D"color: #066;" class=3D"styled-by-prettify">40</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">]</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 xor =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettify"=
>1</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 test =C2=A0 =C2=A0al</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> al<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 jne =C2=A0 =C2=
=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify">L20<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prettify">-=
</span><span style=3D"color: #066;" class=3D"styled-by-prettify">28</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">]</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 mov =C2=A0 =C2=A0 rdi</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 call =C2=A0 =C2=A0W</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">doit</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0=
 =C2=A0 ebx</span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> eax<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">[</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify">rbp</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">-</span><span style=3D"color: #066;" class=3D"styled-by-prettify">27</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">]</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 mov =C2=A0 =C2=A0 rdi</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 call =C2=A0 =C2=A0Y</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify">doit</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 add =
=C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> e=
bx<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 DWORD PTR </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">[</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">rbp</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">-</span><span style=3D"color: #066;" cl=
ass=3D"styled-by-prettify">20</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">],</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 jmp =C2=A0 =C2=A0 </span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">L14<br></span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify">L19</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 nop<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 nop<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">[</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify">rbp</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">-</span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">22</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rdi</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 call =
=C2=A0 =C2=A0X</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">doit=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 mov =C2=A0 =C2=A0 ebx</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">[</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify">rbp</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">-</span><span style=3D"color: #066;" class=
=3D"styled-by-prettify">21</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">]</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rdi</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 call =C2=A0 =C2=A0Z</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">doit</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(=
)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 add =C2=A0 =C2=A0 eax</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> ebx<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =
=C2=A0 DWORD PTR </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">[</span><span style=3D"color: #000;" class=3D"styled-by-prettify">rb=
p</span><span style=3D"color: #660;" class=3D"styled-by-prettify">-</span><=
span style=3D"color: #066;" class=3D"styled-by-prettify">20</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">],</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 jmp =C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">L14<br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
..</span><span style=3D"color: #000;" class=3D"styled-by-prettify">L20</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 nop<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">[</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">rbp</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">-</span><span style=3D"color: #066;" class=3D"styled-by-=
prettify">24</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rdi</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 call =C2=A0 =
=C2=A0W</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">doit</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 mov =C2=A0 =C2=A0 ebx</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 lea =C2=A0 =C2=A0 rax</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">[</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify">rbp</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">-</span><span style=3D"color: #066;" class=3D"style=
d-by-prettify">23</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">]</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 rdi</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> rax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 call =
=C2=A0 =C2=A0Z</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">doit=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 add =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> ebx<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 DWORD=
 PTR </span><span style=3D"color: #660;" class=3D"styled-by-prettify">[</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">rbp</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">-</span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">20</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">],</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 nop<br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify">L14</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =
=C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> D=
WORD PTR </span><span style=3D"color: #660;" class=3D"styled-by-prettify">[=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">rbp</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">-</span><span sty=
le=3D"color: #066;" class=3D"styled-by-prettify">20</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">]</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 add =C2=A0 =
=C2=A0 rsp</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
,</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #066;" class=3D"styled-by-prettify">40</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 pop =C2=A0 =C2=A0 rbx<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 pop =C2=A0 =C2=
=A0 rbp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret</span></div></code></div><br>Wit=
h -O3<br><br><div style=3D"background-color: rgb(250, 250, 250); border-col=
or: rgb(187, 187, 187); border-style: solid; border-width: 1px; overflow-wr=
ap: break-word;" class=3D"prettyprint"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-prett=
ify">example</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">bool</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">):</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 test =C2=A0 =
=C2=A0dil</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> dil<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 mov =C2=A0 =C2=A0 eax</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D=
"styled-by-prettify">6</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 je =C2=A0 =C2=A0 =C2=A0</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">L1<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 xor =C2=A0 =C2=A0 eax</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> eax<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 test =C2=A0 =C2=A0sil</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> sil<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 sete =C2=A0 =C2=A0al<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 add =C2=A0 =C2=
=A0 eax</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><spa=
n style=3D"color: #066;" class=3D"styled-by-prettify">4</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">L1</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 rep ret</span></div></code><=
/div><br><br><br><br><br>Am Montag, 22. Mai 2017 08:33:33 UTC+2 schrieb ma.=
ka...@web.de:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">=
Sure, you don&#39;t have always exponential growth when using templates. Bu=
t if you simulating this case with template functions you end up having the=
 same problem.<br>So I wouldn&#39;t say, that this something completely new=
.. It is the nature of the problem we try to solve. You have either runtime =
overhad or exponential growth.<br>Maybe there is a way to avoid exponential=
 growth using optimization techniques. Assumably in many cases the optimize=
r will reduce the amount of code anyway.<br>There could be a guaranteed opt=
imization. But I&#39;m not sure which. I will build up an example, where th=
e code isn&#39;t completely optimized away.<br><br>I assume variant is an u=
ntagged union? Let&#39;s try to minimise our examples.<br><br><br>Am Montag=
, 22. Mai 2017 02:12:20 UTC+2 schrieb Thiago Macieira:<blockquote class=3D"=
gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid=
;padding-left:1ex">On domingo, 21 de maio de 2017 13:54:51 PDT <a rel=3D"no=
follow">ma.ka...@web.de</a> wrote:
<br>&gt; Yeah, i realize that. This is something you have to consider if yo=
u&#39;re
<br>&gt; using templates extensively.=20
<br>
<br>No, it isn&#39;t. Today, the use of templates does not imply exponentia=
l growth of=20
<br>generated code.
<br>
<br>That is something completely new with your proposal.
<br>
<br>&gt; This is not the right solution for everything.
<br>&gt; I think in most cases, you use one or at most two ternary operator=
s in one
<br>&gt; place. For three or more ternary operators the runtime overhead is
<br>&gt; assumably the lesser of two evils. But even if it grows exponentia=
lly, the
<br>&gt; constants are pretty small. Normaly only a few instructions are in=
volved.
<br>
<br>Not necessarily. Remember that you may not reevaluate the condition, so=
 either=20
<br>this generates completely separate code paths (and thus the exponential=
=20
<br>expansion) or the result of the evaluation is stored in a hidden variab=
le that=20
<br>is evaluated every time you access that automatic variable.=20
<br>
<br>That is, when you write:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0auto x =3D runtime_cond=
ition1 ? A{} : B{};=20
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0auto y =3D runtime_cond=
itoin2 ? C{} : D{};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0x.f();
<br>
<br>This expands to either:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (runtime_condition1)=
 {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0auto x =3D A{};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0if (runtime_condition2) {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
auto y =3D C {};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
x.f() + y.f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0} else {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
auto y =3D D {};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
x.f() + y.f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0}
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0auto x =3D B{};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0if (runtime_condition2) {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
auto y =3D C {};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
x.f() + y.f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0} else {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
auto y =3D D {};
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
x.f() + y.f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0}
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
<br>
<br>or to:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0variant&lt;A, B&gt; x;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0variant&lt;C, D&gt; y;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool hidden1 =3D runtim=
e_condition1;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (hidden1)
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0x.create&lt;A&gt;();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0else
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0x.create&lt;B&gt;();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool hidden2 =3D runtim=
e_condition2;
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (hidden2)
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0y.create&lt;C&gt;();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0else
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0y.create&lt;D&gt;();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (hidden1) {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0if (hidden2)
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<a href=3D"http://x.as" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"t=
his.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fx.as\x26sa\x3dD=
\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#39;;return true=
;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F=
x.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#=
39;;return true;">x.as</a>&lt;<wbr>A&gt;().f() + <a href=3D"http://y.as" re=
l=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;" onclick=3D"this.href=3D=
&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3=
d1\x26usg\x3dAFQjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;">y.as</a>=
&lt;C&gt;().f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0else
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<a href=3D"http://x.as" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"t=
his.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fx.as\x26sa\x3dD=
\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#39;;return true=
;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F=
x.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#=
39;;return true;">x.as</a>&lt;<wbr>A&gt;().f() + <a href=3D"http://y.as" re=
l=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;" onclick=3D"this.href=3D=
&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3=
d1\x26usg\x3dAFQjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;">y.as</a>=
&lt;D&gt;().f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else {
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0if (hidden2)
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<a href=3D"http://x.as" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"t=
his.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fx.as\x26sa\x3dD=
\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#39;;return true=
;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F=
x.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#=
39;;return true;">x.as</a>&lt;<wbr>B&gt;().f() + <a href=3D"http://y.as" re=
l=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;" onclick=3D"this.href=3D=
&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3=
d1\x26usg\x3dAFQjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;">y.as</a>=
&lt;C&gt;().f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0else
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
<a href=3D"http://x.as" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"t=
his.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fx.as\x26sa\x3dD=
\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#39;;return true=
;" onclick=3D"this.href=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2F=
x.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF_RgZBHEjoHC6BbryEAu7_i-OuOg&#=
39;;return true;">x.as</a>&lt;<wbr>B&gt;().f() + <a href=3D"http://y.as" re=
l=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;" onclick=3D"this.href=3D=
&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fy.as\x26sa\x3dD\x26sntz\x3=
d1\x26usg\x3dAFQjCNEuQstsnF5olzl8yADHUQunU-gAnw&#39;;return true;">y.as</a>=
&lt;D&gt;().f();
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0}
<br>
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" rel=3D"n=
ofollow" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www.googl=
e.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3dD\x26sntz\x3d1\x26usg\x3=
dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return true;" onclick=3D"this.href=
=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3d=
D\x26sntz\x3d1\x26usg\x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return tru=
e;">macieira.info</a> - thiago (AT) <a href=3D"http://kde.org" rel=3D"nofol=
low" target=3D"_blank" onmousedown=3D"this.href=3D&#39;http://www.google.co=
m/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHGR=
Jdo5_JYG1DowztwAHAKs80XSA&#39;;return true;" onclick=3D"this.href=3D&#39;ht=
tp://www.google.com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x=
26usg\x3dAFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;">kde.org</a>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br>
<br></blockquote></div></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/50267964-19d0-4bb2-ba27-f018b58b8aa8%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/50267964-19d0-4bb2-ba27-f018b58b8aa8=
%40isocpp.org</a>.<br />

------=_Part_2508_366975323.1495437220473--

------=_Part_2507_1148003169.1495437220471--

.
