220 10173 <CAFk2RUZ1N-cBt0+zT6Yvz-pJNVapsqO3V81=sEGG3BUiKb-7cw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: std::conditional pick() function?
Date: Fri, 4 Apr 2014 20:50:22 +0300
Lines: 22
Approved: news@gmane.org
Message-ID: <CAFk2RUZ1N-cBt0+zT6Yvz-pJNVapsqO3V81=sEGG3BUiKb-7cw@mail.gmail.com>
References: <CAOHCbisx6OThhgywXSpTVsVM-xzH1HKMGOOsFzXjH6T=+c+qSA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: ger.gmane.org 1396633832 7271 80.91.229.3 (4 Apr 2014 17:50:32 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 4 Apr 2014 17:50:32 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC5JHI7A7ALRBXXB7OMQKGQEAJFG7HA@isocpp.org Fri Apr 04 19:50:25 2014
Return-path: <std-proposals+bncBC5JHI7A7ALRBXXB7OMQKGQEAJFG7HA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f197.google.com ([209.85.213.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBXXB7OMQKGQEAJFG7HA@isocpp.org>)
	id 1WW8G0-0001vc-KL
	for gclcip-std-proposals@m.gmane.org; Fri, 04 Apr 2014 19:50:24 +0200
Original-Received: by mail-ig0-f197.google.com with SMTP id hn18sf2695011igb.8
        for <gclcip-std-proposals@m.gmane.org>; Fri, 04 Apr 2014 10:50:23 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from: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=1Fa5JFpMfjJ+EMLTHI2TlOHPGKGtq7Y6zFYmCSp+v/0=;
        b=g7Pgfp/Yb1mCgGAJHuANm9Kv5+IJJET7PJAvPHzfpOy+2Mvky6JZPDspIyA6POsc2S
         7se829+O53VNTXxucOPF2Ho0VX0z/3+D46vKrwCs1ugT+aRa8K8XGmsQtqTxq4jg16do
         p+phI+qqhdT1KlSk4K5pjWWnMuuCzHcaanUlC/ICS1T+5DcgXyAVfvXThoC62TpifZ0J
         VevtyCSlta1/v8k73ItZ4mu4jM6jNPuII6w+nteHRa0sTlYpst2mtbE/kTJHHPLI/Fi8
         1S0Vk9PQMY/g3ARWZyf+YlMN5xNdMrERLhG+PZKWz+3ls4LiXiNx0AHJfyJkOsCpdqC+
         85vA==
X-Gm-Message-State: ALoCoQkfxBfg0pcUgrqVNjbSMLS5qqRW21COOoFmk1tLeVl+4u8wD28JrXZ/gUhmfBB0BVT8q9Sx
X-Received: by 10.50.62.106 with SMTP id x10mr2582136igr.2.1396633823542;
        Fri, 04 Apr 2014 10:50:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.106.202 with SMTP id e68ls557346qgf.12.gmail; Fri, 04 Apr
 2014 10:50:22 -0700 (PDT)
X-Received: by 10.224.163.10 with SMTP id y10mr3733105qax.102.1396633822754;
        Fri, 04 Apr 2014 10:50:22 -0700 (PDT)
Original-Received: from mail-qa0-x236.google.com (mail-qa0-x236.google.com [2607:f8b0:400d:c00::236])
        by mx.google.com with ESMTPS id v6si3746073qas.275.2014.04.04.10.50.22
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 04 Apr 2014 10:50:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c00::236 as permitted sender) client-ip=2607:f8b0:400d:c00::236;
Original-Received: by mail-qa0-f54.google.com with SMTP id w8so3485108qac.13
        for <std-proposals@isocpp.org>; Fri, 04 Apr 2014 10:50:22 -0700 (PDT)
X-Received: by 10.224.13.142 with SMTP id c14mr16507504qaa.76.1396633822637;
 Fri, 04 Apr 2014 10:50:22 -0700 (PDT)
Original-Received: by 10.224.10.17 with HTTP; Fri, 4 Apr 2014 10:50:22 -0700 (PDT)
In-Reply-To: <CAOHCbisx6OThhgywXSpTVsVM-xzH1HKMGOOsFzXjH6T=+c+qSA@mail.gmail.com>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of ville.voutilainen@gmail.com designates 2607:f8b0:400d:c00::236 as
 permitted sender) smtp.mail=ville.voutilainen@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:10173
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10173>

On 4 April 2014 20:37, Tony V E <tvaneerd@gmail.com> wrote:
> Does anyone else (besides me) need a function like
>
>     template<bool B, typename X, typename Y>
>     std::conditional<B,X,Y>::type pick(X x, Y y);
>
> that returns x or y (and type X or Y) based on the compile-time bool?


I have certainly written a run-time version of it umpteen times. At those times
I didn't have the possibility to write a compile-time version. Whether that
is sufficient reason to standardize it is another matter. Very mildly
in favor...

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
