220 31770 <CALQmNFiye2=681BUYyrYXhhYd-ub0X=Qu0LaOqoj-2YLApFCKQ@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Sean Middleditch <sean.middleditch@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Complexities caused by using unique_ptr and
 move semantics
Date: Sun, 26 Mar 2017 20:59:56 -0700
Lines: 137
Approved: news@gmane.org
Message-ID: <CALQmNFiye2=681BUYyrYXhhYd-ub0X=Qu0LaOqoj-2YLApFCKQ@mail.gmail.com>
References: <46a85060-631b-49e5-94f3-ab07429d8085@isocpp.org>
 <86aeb556-e0d7-4d68-b553-1b4163461473@isocpp.org> <136fc743-bc63-48c8-b1d5-dc4084dd13cf@isocpp.org>
 <CALQmNFgAe4B2tiqjA7Mq1TWXWdt-OMAUD41AKzuxh_6_X=uRcQ@mail.gmail.com> <0d3f5162-b2f9-4389-a0ec-4e3928492fa3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=94eb2c060d025dda68054bae6056
X-Trace: blaine.gmane.org 1490587201 31307 195.159.176.226 (27 Mar 2017 04:00:01 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 27 Mar 2017 04:00:01 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCDODCNR2QPRBPM44LDAKGQE6435OGI@isocpp.org Mon Mar 27 05:59:54 2017
Return-path: <std-proposals+bncBCDODCNR2QPRBPM44LDAKGQE6435OGI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCDODCNR2QPRBPM44LDAKGQE6435OGI@isocpp.org>)
	id 1csLou-0007Im-9y
	for gclcip-std-proposals@m.gmane.org; Mon, 27 Mar 2017 05:59:52 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id d191sf65484891ywe.7
        for <gclcip-std-proposals@m.gmane.org>; Sun, 26 Mar 2017 20:59:58 -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
         :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=gJYFUFqyOaxOFRAHeMb6EedEOpGCEDKL4XtbHPGc9VI=;
        b=dhetqVI7OzXrDWgIN9EWhRJ8cXnKfnNNPs0ROMV6lByhRhwpIqBxq8SArGNoGH22q5
         6Ap1CQqgEEjACdYI+lytJHcROUc5W3+/nCXVrOEyL9AxhxGi62ux1Lh7Zu6zvNPf5O/S
         Jlld1xoJ6bfesUUL9dPwgflfmoFheQtDv56aHdisMC8Wakl3gaD96tVSHg3K9Ud9yx12
         VLTnCV9flrX7IfnzXXuC70lhSR3rGLjixZV0nEj2FRVzix1lbeeeJBtRSN9F1ROtkgeW
         rc479tJQkuIhNhMXNeiQFTQazJX4LxDZljPZzkRrPgHdMtUI1h5h7NnNwcxFbnhBZZkF
         1rCg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to: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=gJYFUFqyOaxOFRAHeMb6EedEOpGCEDKL4XtbHPGc9VI=;
        b=PpM8bSkYzhGAFVGrstf3GxeOW6h5Z4vauxazkrr2k0xXoehb4N1TzosQ3QFjM7FLeJ
         sfwZRuasOhyhy5JzdXWtknqbeOg3Ax1nUNbcQQjn1OTi8mnrmI3/4jwVCsYmZPsMpN7B
         DwZFqbT6isgnTCfcNuBM1KuSc2Q5YwBwOurCOr5DZQfhCCV7ogRrg+05xLYVF7xOzSfW
         bmOOHQ5LoM8sx7eAoib7yDzoE8mPPwo+WodUECBXSLHxTemTDVPEjIwq3PMZUZHrSstx
         lUHPg610C3/7DqNkSWYw4wzFjupW+wrMHMi6T70NqwnjWSjT8DP9rDjyM2vmeE5QI4+R
         kzaA==
X-Gm-Message-State: AFeK/H0Tt8Pwj7wS2z2InogWENWhU33lG7L7zlBqHiSzkEKuJXSq/wpGsI99J9F35QeY2A==
X-Received: by 10.129.55.195 with SMTP id e186mr5641198ywa.0.1490587197951;
        Sun, 26 Mar 2017 20:59:57 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.7.18 with SMTP id 18ls11410285ote.1.gmail; Sun, 26 Mar
 2017 20:59:57 -0700 (PDT)
X-Received: by 10.200.46.91 with SMTP id s27mr20789384qta.278.1490587197076;
        Sun, 26 Mar 2017 20:59:57 -0700 (PDT)
Original-Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com. [2607:f8b0:400d:c09::22d])
        by mx.google.com with ESMTPS id j63si2091761qte.41.2017.03.26.20.59.57
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 26 Mar 2017 20:59:57 -0700 (PDT)
Received-SPF: pass (google.com: domain of sean.middleditch@gmail.com designates 2607:f8b0:400d:c09::22d as permitted sender) client-ip=2607:f8b0:400d:c09::22d;
Original-Received: by mail-qk0-x22d.google.com with SMTP id p22so28611973qka.3
        for <std-proposals@isocpp.org>; Sun, 26 Mar 2017 20:59:57 -0700 (PDT)
X-Received: by 10.55.176.198 with SMTP id z189mr17520094qke.14.1490587196707;
 Sun, 26 Mar 2017 20:59:56 -0700 (PDT)
Original-Received: by 10.237.47.65 with HTTP; Sun, 26 Mar 2017 20:59:56 -0700 (PDT)
Original-Received: by 10.237.47.65 with HTTP; Sun, 26 Mar 2017 20:59:56 -0700 (PDT)
In-Reply-To: <0d3f5162-b2f9-4389-a0ec-4e3928492fa3@isocpp.org>
X-Original-Sender: Sean.Middleditch@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com;       spf=pass (google.com: domain of
 sean.middleditch@gmail.com designates 2607:f8b0:400d:c09::22d as permitted
 sender) smtp.mailfrom=sean.middleditch@gmail.com;       dmarc=pass (p=NONE
 sp=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: <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:31770
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/31770>

--94eb2c060d025dda68054bae6056
Content-Type: text/plain; charset=UTF-8

On Mar 26, 2017 6:12 PM, "Nicol Bolas" <jmckesson@gmail.com> wrote:



On Sunday, March 26, 2017 at 6:11:08 PM UTC-4, Sean Middleditch wrote:

> On Fri, Mar 24, 2017 at 3:25 PM, Nicol Bolas <jmck...@gmail.com> wrote:
>
>>
>>> Basically, you want to write something like:
>>>
>>>   iterable<T&> foo::get_things() { return make_iterable(_things,
>>> [](auto& p){ return *p; }); }
>>>
>>>
>> That's a really bad tradeoff: type-erasing performance plus the cost of
>> filtering, all just to gain some increased genericity.
>>
>
> Not at all, because that'd be a template that gets fully inlined and
> result in identical machine code (assuming a suitably capable optimizer).
>

How? `iterable` doesn't specify the


It's an expositional snippet. This might shock and surprise you, but it
wasn't copied verbatim from a working "thingy" codebase I just had lying
around. :)

I expect that `Iterator` could be defined as a concept in C++2x. The C++14
template version should use `auto` as the return value, yes. My mistake.

Thanks for the totally necessary lesson on runtime abstraction costs though.


-- 
You received this message because you are subscribed to a topic in the
Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this topic, visit https://groups.google.com/a/
isocpp.org/d/topic/std-proposals/nc5Sj-LtKbA/unsubscribe.
To unsubscribe from this group and all its topics, 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/0d3f5162-b2f9-4389-
a0ec-4e3928492fa3%40isocpp.org
<https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/0d3f5162-b2f9-4389-a0ec-4e3928492fa3%40isocpp.org?utm_medium=email&utm_source=footer>
..

-- 
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/CALQmNFiye2%3D681BUYyrYXhhYd-ub0X%3DQu0LaOqoj-2YLApFCKQ%40mail.gmail.com.

--94eb2c060d025dda68054bae6056
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_extra"><div class=3D"gmail_quote=
">On Mar 26, 2017 6:12 PM, &quot;Nicol Bolas&quot; &lt;<a href=3D"mailto:jm=
ckesson@gmail.com">jmckesson@gmail.com</a>&gt; wrote:<br type=3D"attributio=
n"><blockquote class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr"><br><br>On Sunday, March 26, 2=
017 at 6:11:08 PM UTC-4, Sean Middleditch wrote:<div class=3D"quoted-text">=
<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;borde=
r-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D=
"gmail_quote">On Fri, Mar 24, 2017 at 3:25 PM, Nicol Bolas <span dir=3D"ltr=
">&lt;<a rel=3D"nofollow">jmck...@gmail.com</a>&gt;</span> wrote:<br><block=
quote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc=
 solid;padding-left:1ex"><div dir=3D"ltr"><span><blockquote class=3D"gmail_=
quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;paddi=
ng-left:1ex"><div dir=3D"ltr"><div><br></div><div>Basically, you want to wr=
ite something like:</div><div><br></div><div>=C2=A0 iterable&lt;T&amp;&gt; =
foo::get_things() { return make_iterable(_things, [](auto&amp; p){ return *=
p; }); }<br></div><div><br></div><div></div></div></blockquote></span><div>=
<br>That&#39;s a really bad tradeoff: type-erasing performance plus the cos=
t of filtering, all just to gain some increased genericity. <br></div></div=
></blockquote><div><br></div><div>Not at all, because that&#39;d be a templ=
ate that gets fully inlined and result in identical machine code (assuming =
a suitably capable optimizer).</div></div></div></div></blockquote></div><d=
iv><br>How? `iterable` doesn&#39;t specify the</div></div></blockquote></di=
v></div></div><div dir=3D"auto"><br></div><div dir=3D"auto">It&#39;s an exp=
ositional snippet. This might shock and surprise you, but it wasn&#39;t cop=
ied verbatim from a working &quot;thingy&quot; codebase I just had lying ar=
ound. :)</div><div dir=3D"auto"><br></div><div dir=3D"auto">I expect that `=
Iterator` could be defined as a concept in C++2x. The C++14 template versio=
n should use `auto` as the return value, yes. My mistake.</div><div dir=3D"=
auto"><br></div><div dir=3D"auto">Thanks for the totally necessary lesson o=
n runtime abstraction costs though.</div><div dir=3D"auto"><br></div><div d=
ir=3D"auto"><div class=3D"gmail_extra"><div class=3D"gmail_quote"><blockquo=
te class=3D"quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><br></div><div class=3D"quoted-text">

<p></p>

-- <br>
You received this message because you are subscribed to a topic in the Goog=
le Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/nc5Sj-LtKbA/unsubscribe" target=3D"_blan=
k">https://groups.google.com/a/<wbr>isocpp.org/d/topic/std-<wbr>proposals/n=
c5Sj-LtKbA/<wbr>unsubscribe</a>.<br>
To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_blank">std-prop=
osals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></div>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/0d3f5162-b2f9-4389-a0ec-4e3928492fa3%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/0d3f=
5162-b2f9-4389-<wbr>a0ec-4e3928492fa3%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div></div></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/CALQmNFiye2%3D681BUYyrYXhhYd-ub0X%3DQ=
u0LaOqoj-2YLApFCKQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALQmNFiye2%3=
D681BUYyrYXhhYd-ub0X%3DQu0LaOqoj-2YLApFCKQ%40mail.gmail.com</a>.<br />

--94eb2c060d025dda68054bae6056--

.
