220 32558 <27694795.c6R7qxKFE5@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: relaxing rules for ternary operator. Allow
 incompatible types.
Date: Sun, 21 May 2017 10:08:16 -0700
Lines: 27
Approved: news@gmane.org
Message-ID: <27694795.c6R7qxKFE5@tjmaciei-mobl1>
References: <1b5ee8eb-53df-4e98-af2f-829c7bc2e5b2@isocpp.org> <9064929.QEV8q21eIZ@tjmaciei-mobl1> <99350a9e-0c6b-468d-9761-f2b2b052275e@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1495386502 1359 195.159.176.226 (21 May 2017 17:08:22 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 21 May 2017 17:08:22 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBBETQ7EQKGQEFNL75UQ@isocpp.org Sun May 21 19:08:17 2017
Return-path: <std-proposals+bncBCB4TK757YBRBBETQ7EQKGQEFNL75UQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f72.google.com ([209.85.215.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBBETQ7EQKGQEFNL75UQ@isocpp.org>)
	id 1dCUL1-0000DP-Li
	for gclcip-std-proposals@m.gmane.org; Sun, 21 May 2017 19:08:15 +0200
Original-Received: by mail-lf0-f72.google.com with SMTP id d198sf5488150lfg.0
        for <gclcip-std-proposals@m.gmane.org>; Sun, 21 May 2017 10:08:21 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1495386501; cv=pass;
        d=google.com; s=arc-20160816;
        b=EOdHWANbvyCXw+TXibhdWWBhvStz+GwkAK8OFQb573tN/YUhVv1qBNwkACrdC1Daa4
         WnAAlAnh0iO2eh2wdGnYQWk2R6en/XIM8aGxY4+nV5QeATASBBkMdUOBfrsvK0WTuGqv
         St8+FiZ6QP7RKhMWl5ljt5cNGPqZK3MzkE80sRWcny6cCKJ/nyAjXWHecIHdQVTUHQCt
         uX2X7+MnBirEEA5fhHmQZ+iqMWsrOXK4WiE6O9X2XaX7sjxGEOQ3s4kqxt8VV2zeatto
         sly82GlzbeXtH6pCv/pZYS2Jm9EAyPuWyu5GKNEr9/Rxb2ZKEpRsfNOXOPpGwX6v1Qj2
         ohgw==
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:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=kGM5EIK2WHL/KaJdY/3cHz0yaXA92I53f/8x/Sl27QA=;
        b=Sp0IEa+jaugOmnhJV75TxSbj5HBLs+AizGPOAs8Gv+yTx+XKpdGS0SmbmM/qCm8X0v
         abeTYnV82S1cW/RTj5Fhkd1C/yNkAfAUUoZBg49K89j7ptFIzlUFtJ/k3ZHqFHzlWePH
         xTgZD+s9Hp98/m3lvpFCqExf0jkXBByLGkyAcdBtznZrkSEHs8ph+6yxnhbiKqlJPCgO
         iVtfMOtlH0PsI2NeFuQTB8B4KX6GiSbAfAouyoUkm4YgJo0XpNPd6juMkPK1rIKoV/XW
         P0V+EFmNvMtlukFb8ERn2d4+sukCZ4M8ARUn0llX70IppmUdSzLtoFstxEC8gcaA6web
         Zmjg==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :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=kGM5EIK2WHL/KaJdY/3cHz0yaXA92I53f/8x/Sl27QA=;
        b=f+9vwoBSH0EO3R/TPFojU59jOmKU6rKRE6cPJH2hU6D79RjuQ0Eez65uO5h4jjkU5j
         m/B2ggqeta1Z+UKZ9BUHah7HhvGYCeIGYC8xAEISpYuTHFhppVeOioFlV6etGDuvMTG0
         NoSSQhaSWmmwmwzEwwTngI6xMHrsXzBvBPdWqpqYCSlMlzujQMbJmuEIgTz/ANKWjCAY
         ONn7kgAxj5/rJMlQ4UXk9hSngLjeam6GjZU+7DB6A6ZIypbkzy6T3yhZfIdiXeDJzKcj
         svLGK5vp8nzmd1JwjqkJW7ePW41M0yqaf01NflpgxOM/syy9k9w+JTpXyhcrCcwPTWI2
         T7zA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version: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=kGM5EIK2WHL/KaJdY/3cHz0yaXA92I53f/8x/Sl27QA=;
        b=D0G3U4egr+6R8WGp+2Qv6AfwtQraJajxEwkFc9KSKEHXsV7du+lo9xwdp+Cc3+IEOU
         +1E4ua7Dxx6J952wX0NU7UYkNZQ4DIuPlFfJ24O9Sfz6AACcni8K0tWSlQ3PUUtNHHve
         po5xWe+ZnhGW9eg6cLx6HLXpa0JcNTevOk/mjtEkbMbTjmfhfd190xN/AMN3Ar/sSR9x
         KJ/S7zjoTIVvo/DfPS5RfFLT53AcFEjwF9TjT5krHA3gMCSbk01kdV3pY33jK/u1NGZQ
         mU813XyDpyLsdLQA8w51smucKYIyCiI8oNx6XexoJTthGuiBuhiphk8xLagKuEgx4DUT
         9ULQ==
X-Gm-Message-State: AODbwcAkV451m7gTy/q90CVxrtOxoLBoliLBdC3frTF5VvLZUzh37T9D
	q3PombTfWDzpJldj
X-Received: by 10.46.69.84 with SMTP id s81mr2050037lja.17.1495386501129;
        Sun, 21 May 2017 10:08:21 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.164.196 with SMTP id n187ls396188wme.23.canary-gmail; Sun,
 21 May 2017 10:08:19 -0700 (PDT)
X-Received: by 10.28.134.3 with SMTP id i3mr24436035wmd.68.1495386499741;
        Sun, 21 May 2017 10:08:19 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1495386499; cv=none;
        d=google.com; s=arc-20160816;
        b=bNzZLJ4Ww0NmLCjjpZ1LVoSK+wFSnKTUox1SGqqYWOTVK0Z2sr1h0s/iLJlMlGbP2b
         f00GGs3mGjF03cDauFo7Ej/3P2RPRn8JVJIFV+qC9xlLRLcpSjv2xUro771p2odQyP5p
         souZ6rQXHBPakUUy4E9DF1kWF3/RnobmL2bvPIZM/nuQlsta8ixf1jNgOxrGsj7/c/2l
         2MYKITaT2ErrWDWCZvEePQvA7xB9o/KgNPXAaQTiD1Ey/DIgYR9yMobtESc1+pisVsr8
         uekJb11AejLFFN5AcvmyMd50cq/jLa7sOAmNh6mnwz693lPZ6YDJkkPWfPjKHLNbJYTP
         xp4w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=5gP6JC/qlgDgwDUzJgMe5mPhWM3zkr9eQfwcFiPIWBA=;
        b=hvVElOaLEg6r/30B1ejIIkM19rssmyV0hlPyN4gEfbZE5JD4ejllZFG5LPhGUWgNlm
         kzYjTiqLLvsUo6g5oIOFj0QWSBp3vfTwenb6dcvkhmFMLdfDL76EPOtAtTgDW3njZtLV
         5U+qU1iU7B5JBOsWtM/UB5nSx2i2FxcvPuH0pfKPwPeKKMZL6pZAlgXSm/r4ciFZnsRM
         lCdYQDLoRgNGcZTZnLaKSWHsXM/YLQ66QHeb8TjuI+9taHpe5hlmOLD+gQ+nT7R0St76
         Hgf5kuC7yqExXcdhb6bZFDau3/H3xujFLCEs/nIaRj/wnprzc5EeB8Z9lzuNUPOOoPSs
         oBtw==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id b196si10097551wmd.86.2017.05.21.10.08.19
        for <std-proposals@isocpp.org>;
        Sun, 21 May 2017 10:08:19 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:8466:3462:d05f:7085])
	by gondolin.macieira.info (Postfix) with ESMTPSA id A494812C001
	for <std-proposals@isocpp.org>; Sun, 21 May 2017 10:08:18 -0700 (PDT)
In-Reply-To: <99350a9e-0c6b-468d-9761-f2b2b052275e@isocpp.org>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-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:32558
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32558>

On domingo, 21 de maio de 2017 02:03:45 PDT ma.kalbfuss@web.de wrote:
> The code, following the ternary statement is moved into a generic lambda.
> auto x = runtime_condition ? A{} : B{};
> 
> The generic lambda is instantiated two times, for each branch. Depending on
> runtime_condition,
> only one instance is executed. The statement

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{};
	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/27694795.c6R7qxKFE5%40tjmaciei-mobl1.

.
