220 10180 <9905A61B-89E1-4F7E-BD12-D5815A951FCC@gmail.com> article
Path: news.gmane.org!not-for-mail
From: David Krauss <potswa@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::conditional pick() function?
Date: Sat, 5 Apr 2014 14:18:41 +0800
Lines: 60
Approved: news@gmane.org
Message-ID: <9905A61B-89E1-4F7E-BD12-D5815A951FCC@gmail.com>
References: <CAOHCbisx6OThhgywXSpTVsVM-xzH1HKMGOOsFzXjH6T=+c+qSA@mail.gmail.com> <CAFk2RUZ1N-cBt0+zT6Yvz-pJNVapsqO3V81=sEGG3BUiKb-7cw@mail.gmail.com> <CAOHCbivZHf=Y68SXziT+_SNwJ9X7s1TA8NoeebUaxdJwkbdBhw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\))
Content-Type: multipart/alternative; boundary="Apple-Mail=_DB776959-7D28-4363-9555-2E47E7A27221"
X-Trace: ger.gmane.org 1396678808 5044 80.91.229.3 (5 Apr 2014 06:20:08 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sat, 5 Apr 2014 06:20:08 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCW25A7E3QCRBDWB72MQKGQEH7M4EDQ@isocpp.org Sat Apr 05 08:20:01 2014
Return-path: <std-proposals+bncBCW25A7E3QCRBDWB72MQKGQEH7M4EDQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pd0-f199.google.com ([209.85.192.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCW25A7E3QCRBDWB72MQKGQEH7M4EDQ@isocpp.org>)
	id 1WWJxQ-0003yi-Va
	for gclcip-std-proposals@m.gmane.org; Sat, 05 Apr 2014 08:20:01 +0200
Original-Received: by mail-pd0-f199.google.com with SMTP id x10sf14448785pdj.6
        for <gclcip-std-proposals@m.gmane.org>; Fri, 04 Apr 2014 23:19:59 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:message-id:mime-version:subject:date
         :references:to:in-reply-to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=7xcS1Dz9bFUvjGrclx1NUZC3Bs6heTg2pa1TaqWEeZE=;
        b=fhzlcIeuLwbuYfhVJkUUgtjQQsPyWfctSGuq7/zG3zbEdW9UFEttVHhZMRChFfPqVA
         Bqe/J49CFDn0Fr1N6GQP4jIW3en2l9T9liLeBg0gWFXd5dvIDk1r8i0oU1+VASmEdhXV
         Owv6EgHe4+vBbBGJYWtMhGlwHxlN4K66scUabO7lON8aIvJXq9NxnJhTXfNl/9WtzhX8
         9b8h+rVm6MCHfsdPefVxEFsqlIPsb2TTeChz4a1HW7QuR7FUdSEFyAZ4s2gA/Vd6kCDP
         CeQwbNUt/wxW0/KaF52yHkDdKTRM8jKGTKNZaHYXEiBfQBD98FoHHKJOoxRyMpVCgtCe
         t4QA==
X-Gm-Message-State: ALoCoQngrRPhC2wAl0BrEejca7TC4j8Zh9HHzrUABvtcBEoxGfGgajEXPzUjmmhSluv5ako6fc7t
X-Received: by 10.66.122.69 with SMTP id lq5mr7201376pab.17.1396678799516;
        Fri, 04 Apr 2014 23:19:59 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.57.104 with SMTP id h8ls941905igq.0.gmail; Fri, 04 Apr 2014
 23:19:58 -0700 (PDT)
X-Received: by 10.69.2.2 with SMTP id bk2mr19143900pbd.75.1396678798348;
        Fri, 04 Apr 2014 23:19:58 -0700 (PDT)
Original-Received: from mail-pa0-x236.google.com (mail-pa0-x236.google.com [2607:f8b0:400e:c03::236])
        by mx.google.com with ESMTPS id my2si5493726pbc.197.2014.04.04.23.19.58
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 04 Apr 2014 23:19:58 -0700 (PDT)
Received-SPF: pass (google.com: domain of potswa@gmail.com designates 2607:f8b0:400e:c03::236 as permitted sender) client-ip=2607:f8b0:400e:c03::236;
Original-Received: by mail-pa0-f54.google.com with SMTP id lf10so4412885pab.13
        for <std-proposals@isocpp.org>; Fri, 04 Apr 2014 23:19:58 -0700 (PDT)
X-Received: by 10.68.237.38 with SMTP id uz6mr19218139pbc.72.1396678798197;
        Fri, 04 Apr 2014 23:19:58 -0700 (PDT)
Original-Received: from [172.20.10.2] ([121.54.54.150])
        by mx.google.com with ESMTPSA id it4sm21992397pbd.48.2014.04.04.23.19.40
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 04 Apr 2014 23:19:57 -0700 (PDT)
In-Reply-To: <CAOHCbivZHf=Y68SXziT+_SNwJ9X7s1TA8NoeebUaxdJwkbdBhw@mail.gmail.com>
X-Mailer: Apple Mail (2.1874)
X-Original-Sender: potswa@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of potswa@gmail.com designates 2607:f8b0:400e:c03::236 as permitted
 sender) smtp.mail=potswa@gmail.com;       dkim=pass header.i=@gmail.com;
       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:10180
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10180>

--Apple-Mail=_DB776959-7D28-4363-9555-2E47E7A27221
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=ISO-8859-1

This sounds an awful lot like a C11 type-generic expression. A TGE uses the=
 type of an unevaluated controlling expression to select among several sube=
xpressions. The type and value of the TGE are those of the selected subexpr=
ession; the other subexpressions are not evaluated.

TGEs do more than std::conditional can do, but less than the proposed stati=
c_if. I think they just might be an appropriate solution.

	- D

--=20

---=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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_DB776959-7D28-4363-9555-2E47E7A27221
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=ISO-8859-1

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Diso-8859-1"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mo=
de: space; -webkit-line-break: after-white-space;">This sounds an awful lot=
 like a C11 type-generic expression. A TGE uses the type of an unevaluated =
controlling expression to select among several subexpressions. The type and=
 value of the TGE are those of the selected subexpression; the other subexp=
ressions are not evaluated.<div><br></div><div>TGEs do more than <font face=
=3D"Courier">std::conditional</font> can do, but less than the proposed&nbs=
p;<font face=3D"Courier">static_if</font>. I think they just might be an ap=
propriate solution.<br><div><br></div><div><span class=3D"Apple-tab-span" s=
tyle=3D"white-space:pre">	</span>- D</div><div><br></div></div></body></htm=
l>

<p></p>

-- <br />
<br />
--- <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 />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_DB776959-7D28-4363-9555-2E47E7A27221--

.
