220 26931 <CAFk2RUaOii3qgGA7jDZJV6oE-3eoDAQKhmrO8DpUbB3ZVDF6Qg@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: Proposal - non allocating std::function
Date: Thu, 14 Jul 2016 02:26:17 +0300
Lines: 53
Approved: news@gmane.org
Message-ID: <CAFk2RUaOii3qgGA7jDZJV6oE-3eoDAQKhmrO8DpUbB3ZVDF6Qg@mail.gmail.com>
References: <e00db911-40f5-4c11-a4b8-32bba77aa0a5@isocpp.org> <4948193.1toAHviMXG@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1468452390 5203 80.91.229.3 (13 Jul 2016 23:26:30 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Wed, 13 Jul 2016 23:26:30 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBHU4TO6AKGQEOKYMVAQ@isocpp.org Thu Jul 14 01:26:24 2016
Return-path: <std-proposals+bncBC5JHI7A7ALRBHU4TO6AKGQEOKYMVAQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBHU4TO6AKGQEOKYMVAQ@isocpp.org>)
	id 1bNTXr-0002p9-Ov
	for gclcip-std-proposals@m.gmane.org; Thu, 14 Jul 2016 01:26:23 +0200
Original-Received: by mail-wm0-f69.google.com with SMTP id r190sf44536915wmr.0
        for <gclcip-std-proposals@m.gmane.org>; Wed, 13 Jul 2016 16:26:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :content-transfer-encoding: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=nwj+LSO0iAloWxra0h7DacZeWybefUDV9STECnfCG6M=;
        b=xfwQonqBApSvZmEO3AST9ORRpBXlyywtswPuB/Jm3DG7JrHFDzaD3hwSU5iGjl/z34
         Yy+oxGuLEVt4aw5EZZ5TJnQYUA0IXQNvILwbX2vyxQcSARTmgB7qI0vpFJr62By2yHq6
         8wrOsKKeWBkDBLB9Ne0nEDnDUtR/fku5o6zsrKdL09d/y3sorwlwZStDRAeb+CDFdhCf
         7rWaScUhPlFh9jO3GJu8KWktMwSiPQgfXMMJTuKYkTRJiAzu406EQ0Pl4z+jRQCD4oDN
         yAUjaOaaAF1agr5Tb8wfM+KJy+KLGFtBe+Cgm7w/pqYYQQf8t4R+TkvUnjw+Y35OCeCy
         WP/g==
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:from:date
         :message-id:subject:to:content-transfer-encoding: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=nwj+LSO0iAloWxra0h7DacZeWybefUDV9STECnfCG6M=;
        b=Zs8sktQm+9zzZihVQ8l4eFogUKGuG+cUeTViUPO6s3xIl9EC78F+i5kXE2fwOFGdOd
         5eUHTSctkWQJ8gQ5GmYaxZlPowTP0WFL4OUTSRHaPbYLu8+Q3S0XKOtZ+SyxjkNrAlmJ
         Mr5RbEDFEHp0wtdzd22MsHU/dvXb4HICoGk/pxovCUx0ylwbtSOi1lciTGL++OnKY3sv
         6fras6s3cLZqbYA4JwzCXyqofktt5T2SaVBpq2+SuHpRjuKf3q0NudyNOd/tB8c9RWZM
         dJmv6cGTyMM9kkc+bOfFS5ApwZaoPZ8XnwEwn1zABtJ/g6wYWuBExxAm95NFNibXNm2R
         FBt 
X-Gm-Message-State: ALyK8tLbPYoe4VsGAmIrg550EPjoLhZ1mkMwq+5f3OtoZrxFZ2IWAsCyqkmm8eMGliaMFw==
X-Received: by 10.194.23.166 with SMTP id n6mr545392wjf.5.1468452383030;
        Wed, 13 Jul 2016 16:26:23 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.157.65 with SMTP id g62ls64025wme.17.gmail; Wed, 13 Jul
 2016 16:26:22 -0700 (PDT)
X-Received: by 10.28.129.208 with SMTP id c199mr27859931wmd.79.1468452382294;
        Wed, 13 Jul 2016 16:26:22 -0700 (PDT)
Original-Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com. [2a00:1450:400c:c09::231])
        by mx.google.com with ESMTPS id k3si3853628wmf.64.2016.07.13.16.26.22
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 13 Jul 2016 16:26:22 -0700 (PDT)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 2a00:1450:400c:c09::231 as permitted sender) client-ip=2a00:1450:400c:c09::231;
Original-Received: by mail-wm0-x231.google.com with SMTP id f126so47305220wma.1
        for <std-proposals@isocpp.org>; Wed, 13 Jul 2016 16:26:22 -0700 (PDT)
X-Received: by 10.28.11.79 with SMTP id 76mr12995086wml.91.1468452381907; Wed,
 13 Jul 2016 16:26:21 -0700 (PDT)
Original-Received: by 10.28.203.131 with HTTP; Wed, 13 Jul 2016 16:26:17 -0700 (PDT)
In-Reply-To: <4948193.1toAHviMXG@tjmaciei-mobl1>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 ville.voutilainen@gmail.com designates 2a00:1450:400c:c09::231 as permitted
 sender) smtp.mailfrom=ville.voutilainen@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-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:26931
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26931>

On 14 July 2016 at 02:22, Thiago Macieira <thiago@macieira.org> wrote:
> Em quarta-feira, 13 de julho de 2016, =C3=A0s 15:47:44 PDT, Carl Cook esc=
reveu:
>> Hi all,
>>
>> This is a cross posting from the SG14 reflector, regarding a draft propo=
sal
>> some of us are working on.
>>
>> Very briefly, some of us are interested in having a standardized functio=
n
>> which does not incur an upfront memory allocation to store the callable
>> target, instead opting for a compile time specified buffer (stack
>> allocated). This has been quite useful in several low latency domains su=
ch
>> as gaming and electronic trading. In other words, a drop-in replacement =
for
>> std::function, where all data is on the stack.
>>
>> The original post is
>> here:
>> https://groups.google.com/a/isocpp.org/d/topic/sg14/1Sw_qEdIYes/discussi=
on
>>
>> The resultant draft proposal is
>> here:
>> https://github.com/WG21-SG14/SG14/blob/master/Docs/Proposals/NonAllocati=
ngS
>> tandardFunction.pdf
>
> Hi Carl
>
> Can you explain somewhere why std::function is unable to do that?
>
> In other words, why must std::function allocate memory?


Because it does type erasure and can hold a functor of any size, and
can be assigned to from another functor
of any size. Presumably this new type would fail to initialize if a
functor larger than the internal buffer is used
for initialization or assignment.

--=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.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAFk2RUaOii3qgGA7jDZJV6oE-3eoDAQKhmrO8DpUbB3ZVDF=
6Qg%40mail.gmail.com.

.
