220 26943 <2813901a-dc9d-4c4f-ae07-21a16c0b0da2@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal - non allocating std::function
Date: Wed, 13 Jul 2016 19:25:40 -0700 (PDT)
Lines: 112
Approved: news@gmane.org
Message-ID: <2813901a-dc9d-4c4f-ae07-21a16c0b0da2@isocpp.org>
References: <e00db911-40f5-4c11-a4b8-32bba77aa0a5@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_14_2089011895.1468463141100"
X-Trace: ger.gmane.org 1468463156 6306 80.91.229.3 (14 Jul 2016 02:25:56 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 14 Jul 2016 02:25:56 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBJXQTO6AKGQE7BK3BPI@isocpp.org Thu Jul 14 04:25:48 2016
Return-path: <std-proposals+bncBCEKFTV6ZUMBBJXQTO6AKGQE7BK3BPI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pf0-f199.google.com ([209.85.192.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBJXQTO6AKGQE7BK3BPI@isocpp.org>)
	id 1bNWLQ-0005i7-Jh
	for gclcip-std-proposals@m.gmane.org; Thu, 14 Jul 2016 04:25:44 +0200
Original-Received: by mail-pf0-f199.google.com with SMTP id y134sf75574265pfg.1
        for <gclcip-std-proposals@m.gmane.org>; Wed, 13 Jul 2016 19:25:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=+bVlfbtyyuqkinYExjoh4iKyahZm9XGBkcCNG1cvilo=;
        b=p0WeqVRJ4Izar6v9gLjuZzXM0hSyISfQVrzBq52qPIU2L1yOqWBf40P3WykBMzfRgM
         c/uwEStkdmZOQoPjAsEWQ+lq2c/GXRAwsqWW2ekX5l5Wd3KPZl5XpJcIgaCA1WoOb4ei
         x01cZiTjQeLyV904gvJjDr2PxRF6WdYyd0FaECb1YEMdsrKuuPoHEAnZkVDZYCr+dR8/
         iI9igv+UrOZjWg1WMymIcRFQIqqoRl7KOgI9iVznxTFRPyXjFEyp0HkFq9/GNSkq4yX7
         a1Hxdd235H9/jx7dSXo/WdHZfrF/ElByUI1FHQp21/WLPWraQwUzn7/Os0HY9yJFAYyf
         VFZw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to: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=+bVlfbtyyuqkinYExjoh4iKyahZm9XGBkcCNG1cvilo=;
        b=dHO4oJCkbNMTL1DrsnZ42rOEsVaQUNNMhiqcI/nHPyZxCEz6B611Cd4ObfOyVqEJni
         b3SxjRgpSPjrzxuu2r+z99Dsv0Yx5usFXe5CzZbePxuf4X63ByCYb+8moFDFneDC2Crv
         /z59UwtIYjv9C8J+Xo9g9SHubSz+ZYAjaBsPJJfNgSTLnB0vA7metT1OCGVdcpsNoj/G
         IcOPTuiJPJQXJPR1yfgAQjT6WNHpjhs8H9WaxZqH02cgtUgpLXiT5QJd407+edC9C7KI
         H0RVWoV5MCRYLjYvPZWA6I6fadz32rAsr25zwV+IeSWd80BWrIk+OE28fq7IUIwVpFyo
         TafA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to: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=+bVlfbtyyuqkinYExjoh4iKyahZm9XGBkcCNG1cvilo=;
        b=bYNueUU70zEtjJjt2zYBwm5fMyg2qH26bWIUpj8RbTw8aTmrV948sznvJ2CeMDkhV1
         TJTh3whNPNQ+I3Yw2Q8tWgru/Z5NGw6czMKSvVF49uqfomcrMAY1XllgBb65FwRIFL60
         JyLSRC6kliLCNk1FgjmzjcgwZilYPYSCBUOkgQ9t5NKcNjXROrNDtXMunA1yUftzkttU
         1FMl9SyhIdJuJk1zNsICLiCk1LYtV0WOIVrlw//GNvZK/BfD4v4xFEPyO+oW1Kj1pRCy
         D4mUY43ELWcxHy9ULFH3SKFms0+DnYfloJIMyjK6D8yfrENwqvaTptqKzqIEAXAM8VVk
         hdlQ==
X-Gm-Message-State: ALyK8tIjkQ1fAKd8yDM/kRcNCnhdDGP/bw+ivzXOyYy14fxfHxZKwXjgjCIJtXNPslFM6Q==
X-Received: by 10.66.253.2 with SMTP id zw2mr8678475pac.43.1468463143433;
        Wed, 13 Jul 2016 19:25:43 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.107.18.224 with SMTP id 93ls229352ios.19.gmail; Wed, 13 Jul
 2016 19:25:41 -0700 (PDT)
X-Received: by 10.36.57.15 with SMTP id l15mr1146867ita.7.1468463141926;
        Wed, 13 Jul 2016 19:25:41 -0700 (PDT)
In-Reply-To: <e00db911-40f5-4c11-a4b8-32bba77aa0a5@isocpp.org>
X-Original-Sender: jmckesson@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: 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:26943
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26943>

------=_Part_14_2089011895.1468463141100
Content-Type: multipart/alternative; 
	boundary="----=_Part_15_1052940931.1468463141100"

------=_Part_15_1052940931.1468463141100
Content-Type: text/plain; charset=UTF-8

First, would it be possible to make this proposal available via a PDF *not* 
hosted on GitHub? Like maybe on a github.io page or something, where I can 
view it in my browser instead of having to download it?

Next, I don't believe something like this belongs in the standard. I'm not 
saying that it isn't a useful class. But its utility is *really* special 
case. Much like a string with a user-specified SSO size and so forth. Not a 
bad idea, but just not good for the standard.

I really think it would be a good idea to have some form of "special 
case/low level/etc TS" for these kinds of types. Like the library 
fundamentals TS, but without the expectation that it would ever go into the 
standard wholesale.

As to the idea itself... I'm not really sure about it. My main concern is 
this:

std::inplace_function<int(), VALUE> func()
{
  return [x = 12]() {return x;};
}

What can I set `VALUE` to which will *guarantee* that this code compiles? 
Because I don't think the standard gives us a way to do that. Oh sure, from 
a practical perspective, we can make some guesses about the size of the 
lambda type. But even so, it's not clear that any particular `VALUE` would 
permit compilation.

-- 
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/2813901a-dc9d-4c4f-ae07-21a16c0b0da2%40isocpp.org.

------=_Part_15_1052940931.1468463141100
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">First, would it be possible to make this proposal availabl=
e via a PDF <i>not</i>
 hosted on GitHub? Like maybe on a github.io page or something, where I=20
can view it in my browser instead of having to download it?<br><br>Next, I =
don&#39;t believe something like this belongs in the standard. I&#39;m not =
saying that it isn&#39;t a useful class. But its utility is <i>really</i> s=
pecial case. Much like a string with a user-specified SSO size and so forth=
.. Not a bad idea, but just not good for the standard.<br><br>I really think=
 it would be a good idea to have some form of &quot;special case/low level/=
etc TS&quot; for these kinds of types. Like the library fundamentals TS, bu=
t without the expectation that it would ever go into the standard wholesale=
..<br><br>As to the idea itself... I&#39;m not really sure about it. My main=
 concern is this:<br><br><div class=3D"prettyprint" style=3D"background-col=
or: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: sol=
id; border-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint">=
<div class=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-=
by-prettify">std</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">in=
place_function</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">in=
t</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(),</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> VALUE</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> func</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br></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 </span><span style=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: #660;" class=3D"styled-by=
-prettify">[</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">x </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #066;" class=3D"styled-by-prettify">12</span><span style=
=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: #008;" class=
=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> x</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">;};</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettify">}=
</span></div></code></div><br>What can I set `VALUE` to which will <i>guara=
ntee</i> that this code compiles? Because I don&#39;t think the standard gi=
ves us a way to do that. Oh sure, from a practical perspective, we can make=
 some guesses about the size of the lambda type. But even so, it&#39;s not =
clear that any particular `VALUE` would permit compilation.<br></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/2813901a-dc9d-4c4f-ae07-21a16c0b0da2%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2813901a-dc9d-4c4f-ae07-21a16c0b0da2=
%40isocpp.org</a>.<br />

------=_Part_15_1052940931.1468463141100--

------=_Part_14_2089011895.1468463141100--

.
