220 12480 <ltej8c$rb1$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Jim Porter <jvp4846@g.rit.edu>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Placeholder literals
Date: Mon, 25 Aug 2014 00:57:27 -0500
Lines: 42
Approved: news@gmane.org
Message-ID: <ltej8c$rb1$1@ger.gmane.org>
References: <570663A9-F617-442F-9B48-5B6E7311AE72@gmail.com> <CAOfiQqkd5FeVLM879bHNZwSmdWNyV3Ag9xiOBF0wU=5Ri4iE=A@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
X-Trace: ger.gmane.org 1408946279 28192 80.91.229.3 (25 Aug 2014 05:57:59 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 25 Aug 2014 05:57:59 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDYZZG6PQYFRBXNA5OPQKGQE64OA5WY@isocpp.org Mon Aug 25 07:57:51 2014
Return-path: <std-proposals+bncBDYZZG6PQYFRBXNA5OPQKGQE64OA5WY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-we0-f199.google.com ([74.125.82.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDYZZG6PQYFRBXNA5OPQKGQE64OA5WY@isocpp.org>)
	id 1XLnHr-0002wR-7f
	for gclcip-std-proposals@m.gmane.org; Mon, 25 Aug 2014 07:57:51 +0200
Original-Received: by mail-we0-f199.google.com with SMTP id p10sf7751212wes.6
        for <gclcip-std-proposals@m.gmane.org>; Sun, 24 Aug 2014 22:57:50 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:user-agent: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=w0vnkq4A3/Zdvun2ecjPnN7fCu9LfCSguLYaiAivGL8=;
        b=NGqCDwjUh0uRr2L/fRLGbRHEBmo3xtqaqQ4aI8EXLUkH66T0Gr9Ii1xKAivwRU1ve2
         krrb+bPpeV2OfJoh4Ed+N1RdOzSUt7vOEbhlTdz64ly3xV1vgxkeMfR+Ar4Kr3c8MO+x
         aXryBsmAQq3VZu4nvirIEPaSLOgS1wXh8HuNuoOruraeZ6OqEM9s0X8rPhnK3EuSdcQ7
         h08UGr0Qcx9BIw/FZI0SUWKU1lv4nj1aex8H4xHnyqCUR31zjCUu3tMOzJ9NfeKOd1KW
         GAsC5DsdzuBnR35R9zfZhdSNCephgQ4WUTkND3qXxPAGDl/1gKgljHomTwpp87ZsxFQd
         ptAw==
X-Gm-Message-State: ALoCoQmN4Eruw0sWAjtKiQmizw9jyks/xYZD6octRYRlUJiU9dQbfaOk6KOLErqqWS5e1Vg+nKsu
X-Received: by 10.180.189.69 with SMTP id gg5mr1048574wic.4.1408946270859;
        Sun, 24 Aug 2014 22:57:50 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.10.234 with SMTP id l10ls328095lab.88.gmail; Sun, 24 Aug
 2014 22:57:48 -0700 (PDT)
X-Received: by 10.153.6.39 with SMTP id cr7mr6749339lad.66.1408946268567;
        Sun, 24 Aug 2014 22:57:48 -0700 (PDT)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id ba4si51085349lbc.135.2014.08.24.22.57.48
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Sun, 24 Aug 2014 22:57:48 -0700 (PDT)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1XLnHl-0002tP-EM
	for std-proposals@isocpp.org; Mon, 25 Aug 2014 07:57:45 +0200
Original-Received: from 71-87-112-150.dhcp.mdsn.wi.charter.com ([71.87.112.150])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Mon, 25 Aug 2014 07:57:45 +0200
Original-Received: from jvp4846 by 71-87-112-150.dhcp.mdsn.wi.charter.com with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Mon, 25 Aug 2014 07:57:45 +0200
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 33
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 71-87-112-150.dhcp.mdsn.wi.charter.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.0
In-Reply-To: <CAOfiQqkd5FeVLM879bHNZwSmdWNyV3Ag9xiOBF0wU=5Ri4iE=A@mail.gmail.com>
X-Original-Sender: jvp4846@g.rit.edu
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.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: <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: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:12480
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/12480>

On 8/24/2014 11:45 PM, Richard Smith wrote:
> On Sat, Aug 23, 2014 at 6:21 PM, David Krauss <potswa@gmail.com
> <mailto:potswa@gmail.com>> wrote:
>
>     Why not add literal operator templates returning placeholders?
>
>
> Why not deprecate std::bind? Generic lambdas provide a better solution,
> and we don't benefit from having two ways to do the same thing.

For cases where you're not using placeholders, I sometimes find 
std::bind to be easier to read, e.g. when binding a random number engine 
and a distribution to make a nullary function object. I'd probably use 
std::bind (or something like it) a lot more if I could just 
partially-apply the first N arguments and not have to deal with 
placeholders at all, e.g.:

   int sum(int a, int b, int c) { return a + b + c; }
   auto x = std::partial_apply(sum, 1, 2);
   x(3); // returns 6

Relatedly, it'd be nice if std::mem_fn supported something similar where 
you could bind `this` to it, and get back an N-ary function:

   int MyClass::func(int, int);
   auto x = std::mem_fn(&MyClass::func, this);
   x(1, 2);

In general, I agree that most times you're using placeholders for 
std::bind, a generic lambda would be better, but there might be room for 
some "simple" binding metafunctions to handle the common cases.

- Jim

-- 

--- 
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/.

.
