220 26979 <87poqgyux3.fsf@gmail.com> article
Path: news.gmane.org!not-for-mail
From: Moritz Klammler <moritz.klammler@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Proposal - non allocating std::function
Date: Thu, 14 Jul 2016 19:46:32 +0200
Lines: 32
Approved: news@gmane.org
Message-ID: <87poqgyux3.fsf@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
X-Trace: ger.gmane.org 1468519881 13427 80.91.229.3 (14 Jul 2016 18:11:21 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 14 Jul 2016 18:11:21 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDHI7IWJYALRBN5LT66AKGQE3SE5ZPQ@isocpp.org Thu Jul 14 20:11:14 2016
Return-path: <std-proposals+bncBDHI7IWJYALRBN5LT66AKGQE3SE5ZPQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f69.google.com ([209.85.215.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDHI7IWJYALRBN5LT66AKGQE3SE5ZPQ@isocpp.org>)
	id 1bNl6M-0006Kv-CU
	for gclcip-std-proposals@m.gmane.org; Thu, 14 Jul 2016 20:11:10 +0200
Original-Received: by mail-lf0-f69.google.com with SMTP id l89sf58079689lfi.3
        for <gclcip-std-proposals@m.gmane.org>; Thu, 14 Jul 2016 11:11:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:in-reply-to:message-id:user-agent:mime-version
         :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=kQBI3piDuKArBMzUuh3wfeghY1XYa4z38E6u94tLCPo=;
        b=StLBfr1GU9lS02eUoGkZgufwgHJ6S8i4TD+ea1NVtNUF9dArMJYeuTASKZ90Y4SebK
         wnOl9z771LciQ0hCj3Tz+UaT30s82eq10eMEcfTfjL1t/eXUV5mxZXLzbEXHahAEYGiR
         Fng5OLcqWLRSZlwZzKMQXwj9dIQRv5Va40jBg96icIETDw5qkepN51h7YBvKzhr9sVVI
         nkkCaz5gEHOay6jInHl5OIQBDHGVPIa5q45f5NCynCD+szTS4s43U96KrY6cJ33aDQq5
         etHsNfa5lULhgoJQ0thKekufvyJ8lZXrhSWgZtqcGlnl94pAQuhxQPRPl4dWqzcYA9pw
         zVVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:in-reply-to:message-id
         :user-agent:mime-version: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=kQBI3piDuKArBMzUuh3wfeghY1XYa4z38E6u94tLCPo=;
        b=X5t0hi8B3KfnhDxdxzk3J/LqePHvFlNSkTB1SDSRah18bBe+NSD95Ys25pYCyEfxHj
         yJbnSEPzbk7mAAX8wQ83wlk9FJfhNrhgnd8aFjta4SnuqFtUaG35z5gRivplm2mNJ2lF
         PZd+BOwX1wLKkVd7JSRcrQr7jb6Ti7tv6fr/YkN2xIsS0HRwNShZvMTHOlQUrly0iGMv
         ZsG3TVw0Y8juhQGPZygTnHe860mHT37/1Vou7fUt5t/Uhma8+G50tYK3MLRkccyZrNF3
         7vySS262hjY9ruDOmAdtW3tfK1OmZlbQ0w8E7/fmhLi8voxoDuvsh8/K37eMkpPSd9kY
         snHg==
X-Gm-Message-State: ALyK8tJqIQCozpBBaOeMMQUOdL74UUNnkTQLjWk/y9/iiD4LN/BXSEaFpQaB8mY0TVH+Zw==
X-Received: by 10.46.9.150 with SMTP id 144mr2653348ljj.0.1468519864833;
        Thu, 14 Jul 2016 11:11:04 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.169.144 with SMTP id s138ls4697wme.8.canary; Thu, 14 Jul
 2016 11:11:03 -0700 (PDT)
X-Received: by 10.28.107.144 with SMTP id a16mr18797860wmi.75.1468519863357;
        Thu, 14 Jul 2016 11:11:03 -0700 (PDT)
Original-Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com. [2a00:1450:400c:c09::233])
        by mx.google.com with ESMTPS id y135si33830086wmd.74.2016.07.14.11.11.03
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 14 Jul 2016 11:11:03 -0700 (PDT)
Received-SPF: pass (google.com: domain of moritz.klammler@gmail.com designates 2a00:1450:400c:c09::233 as permitted sender) client-ip=2a00:1450:400c:c09::233;
Original-Received: by mail-wm0-x233.google.com with SMTP id i5so123362071wmg.0
        for <std-proposals@isocpp.org>; Thu, 14 Jul 2016 11:11:03 -0700 (PDT)
X-Received: by 10.28.174.76 with SMTP id x73mr17501717wme.60.1468519862446;
        Thu, 14 Jul 2016 11:11:02 -0700 (PDT)
Original-Received: from moritz-laptop (openvpn-cl-200-65.scc.kit.edu. [141.3.200.65])
        by smtp.gmail.com with ESMTPSA id z5sm3526983wme.5.2016.07.14.11.11.00
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
        Thu, 14 Jul 2016 11:11:00 -0700 (PDT)
In-Reply-To: T. C.'s message of "Wed\, 13 Jul 2016 22\:58\:32 -0700 \(PDT\) \(11
	hours\, 40 minutes\, 48 seconds ago\)"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
X-Original-Sender: moritz.klammler@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 moritz.klammler@gmail.com designates 2a00:1450:400c:c09::233 as permitted
 sender) smtp.mailfrom=moritz.klammler@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:26979
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/26979>

> I'm not clear as to what you mean here. Consider this:
> 
> std::function<void()> a_func()
> {
>   return []{};
> }
> 
> What would the "stack-based array" equivalent look like? Would it look
> as reasonable as this? Would it be able to use that nifty guaranteed
> elision stuff we'll be getting?

I think you'd have to pass the allocator as an argument to `a_func`.  It
would be more involved than your snippet but probably still
"reasonable".  Anyway, this...

> The allocator support in std::function has been zapped as of three
> weeks ago.

makes my entire point obsolete, of course.  The only remaining feedback
I can provide then is to suggest you add a quick note to the motivation
of the proposal that explains this.  I was somehow irritated that the
word "allocator" didn't appear a single time in a paper about memory
allocation.  If allocator support was removed for good reasons and the
proposed approach is considered a superior replacement, mentioning this
explicitly might help the uninvolved reader.

-- 
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/87poqgyux3.fsf%40gmail.com.

.
