220 25484 <42c08c4f-dae2-4705-922b-a1ddf8ca7839@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: inkwizytoryankes@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Relocation as a solution for the valueless
 variant problem?
Date: Fri, 8 Apr 2016 11:51:42 -0700 (PDT)
Lines: 738
Approved: news@gmane.org
Message-ID: <42c08c4f-dae2-4705-922b-a1ddf8ca7839@isocpp.org>
References: <b4feb52d-4cd0-475f-9f3d-6694564bc1b0@isocpp.org>
 <4187538d-68fa-4582-ba26-f406479abe67@isocpp.org>
 <eafd831f-85d2-430c-9969-7d084e6d28d2@isocpp.org>
 <CALQmNFggBQSADjEqS7pEzcdPSStGJfXkJdX0d2CwW_TmwqA=yQ@mail.gmail.com>
 <105d82bc-e1cf-4795-894c-112cd591c3af@isocpp.org>
 <CALQmNFja3Kt1XRR8S7Qr3rOktChVzuDGO7ZtSaQpsWaohU6wAA@mail.gmail.com>
 <4f31b957-05be-47cf-a1ca-03f33a9900c0@isocpp.org>
 <CALQmNFgoV-Rg4T6+KqMFt6vNa7GCDpU=jVLRcnK4dDd+eBby8A@mail.gmail.com>
 <30181f63-7189-494d-9294-3f8b8759308f@isocpp.org>
 <d7eee27f-bdfc-45b0-9c29-508dd01975b3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1046_1148487956.1460141502506"
X-Trace: ger.gmane.org 1460141509 31616 80.91.229.3 (8 Apr 2016 18:51:49 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 8 Apr 2016 18:51:49 +0000 (UTC)
Cc: isocppgroup@denisbider.com
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDDLTAGNTIBBBQH3T64AKGQECURCI6Y@isocpp.org Fri Apr 08 20:51:48 2016
Return-path: <std-proposals+bncBDDLTAGNTIBBBQH3T64AKGQECURCI6Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f199.google.com ([209.85.161.199])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBQH3T64AKGQECURCI6Y@isocpp.org>)
	id 1aobVS-0003yL-6S
	for gclcip-std-proposals@m.gmane.org; Fri, 08 Apr 2016 20:51:46 +0200
Original-Received: by mail-yw0-f199.google.com with SMTP id g133sf151100140ywb.0
        for <gclcip-std-proposals@m.gmane.org>; Fri, 08 Apr 2016 11:51:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:cc: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=ENNp6G7ZS39I2pZiZUg6nN47nPv0ZHLYHj1AKYzj+BQ=;
        b=kJo4ttrFtYtkRSiARs76K6u6KroenJZ7hBdHLAahH3KPhEcgn9XGOWD2vyu0mx9oGT
         8KHVS+2xOiBTcmncxOXWAIdbuW8t3SgjkIaR1O1r4BufZsoAnTOfbVQ1eaiXpHalmvOU
         kTKTv78SSU3yBHK6FsMLqPD+Ymx/E63vCXwXyCWdXoNVGOeRo/70nFkoJP9fDALPeBDa
         BWGtkZtwxHFMTS1Yzls04pIyJ2KPk7Fd49gMeOZ0+nGkurjVtYg2j9YiZ1C/cTfqze7z
         Hf9y8fJC31B7/lVZhenuJvtw/87VQdcNms2VzEskcn9FAiBIC/YjFKLpZ1rOgb58CiD4
         fUZQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc: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=ENNp6G7ZS39I2pZiZUg6nN47nPv0ZHLYHj1AKYzj+BQ=;
        b=T9odPG8JcHha1PzzL/OnlKeGzdfsc0XkmyFTFCKl5raf5MOtyS2uUGo2RRc85XQNtj
         9uMyYVPqpWZjpfHh+0lOtM8zFkBGcSFTlSw5pkpUoh7K9GE/0/TdPFr7o5cj9VQl+0Xm
         ZJHw3693WOY6ZyQ9NsFMduezr0PaJEms3zLjBVkRp4PyIkrdgxc0Kt+sJQvFPs1L52cR
         s0WrBramgdRTVh5zXY2toIostXVO65Nq4OvIfcBRQKB1wPHortHW7bfRClOROPRKBKj9
         s+beRawStWGQRpQQHvnrk08urFuce6f9MwmjwFuK/WHtXVI2q0LJuW8Nr7JSiLzZrk2O
         vUgg==
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:cc: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=ENNp6G7ZS39I2pZiZUg6nN47nPv0ZHLYHj1AKYzj+BQ=;
        b=CSdszIFMuKysMXhl5D06xoDAKYPbOw2Y1z3IBKJ2fgDD66bfrmFwMmbbx0M25FpESK
         kq9q8AR9EXS7RwbMM4IKXrRR4VWjJRJUlojZY5yKBxig2AgNwVqMxh1pHvKgQFJ2xJjY
         KG5MeYos5AEjFDMADDJwVtYNpKM5f7hoXzsiQR7L2wbDqb2Pl8hlxDY1dL8wcT9iJFVL
         FYqkn5o0g2cJFsqkRz+JvchC+5BFG5W6mfDZKYhFyIknvH2151Vgni4eAyNUacbe5I9g
         mD9u9PJjKlooSIZHxTCi4FYXSgRQWWk0MDuQlQumNgR1tHvH6EeWcYHMmvw6BYlBO6Ft
         ErhA==
X-Gm-Message-State: AD7BkJK3SmAJbI9mAVp/36MIubMmTrWpd7ZoCXGOCGt2X799+BHf26SfvMXKY786prj1Yw==
X-Received: by 10.129.79.142 with SMTP id d136mr6871648ywb.9.1460141505115;
        Fri, 08 Apr 2016 11:51:45 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.50.112.129 with SMTP id iq1ls272748igb.17.gmail; Fri, 08 Apr
 2016 11:51:43 -0700 (PDT)
X-Received: by 10.50.129.97 with SMTP id nv1mr124018igb.7.1460141503652;
        Fri, 08 Apr 2016 11:51:43 -0700 (PDT)
In-Reply-To: <d7eee27f-bdfc-45b0-9c29-508dd01975b3@isocpp.org>
X-Original-Sender: inkwizytoryankes@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:25484
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/25484>

------=_Part_1046_1148487956.1460141502506
Content-Type: multipart/alternative; 
	boundary="----=_Part_1047_829198281.1460141502508"

------=_Part_1047_829198281.1460141502508
Content-Type: text/plain; charset=UTF-8



On Friday, April 8, 2016 at 4:12:03 PM UTC+2, Nicol Bolas wrote:
>
> On Friday, April 8, 2016 at 2:07:17 AM UTC-4, isocp...@denisbider.com 
> wrote:
>>
>> Ah, Jesus.
>>
>> It seems to me C++ has become infested with people who call themselves 
>> "modern", but whose objective is to desperately try to divorce the 
>> language from its low-level origins, while ashamedly having to recognize 
>> that this cannot be done, because it would defeat the purpose of the 
>> language and make it useless for its primary role.
>>
>> You are now building this over-ambitious standard library monstrosity, 
>> which is trying to pretend that C++ can be a platform. But the role of C++ 
>> is not to *be* a platform. It is a tool for *building* platforms, and 
>> for building applications on top of existing platforms.
>>
>> I can honestly say I don't like what you're doing, and if you keep going 
>> in this direction, C++ will have to be replaced with something that serves 
>> its original purpose.
>>
>> Stop trying to make this a managed language, for god's sake.
>>
>
> ... So Sean points out how move support introduced a plethora of new value 
> categories in order to ensure that it does not get automatically used in 
> the wrong place. To make sure that it's reasonably safe and usable for most 
> programmers. And he suggests that you should investigate this sort of thing 
> as a way to make sure that your "relocation" is also reasonably safe, that 
> it gets used automatically where appropriate, and that it doesn't get used 
> in improper places. And so forth.
>
> And your response to this is to claim that such commentary comes from 
> people <https://en.wikipedia.org/wiki/Ad_hominem> who are "infesting" the 
> language, that even that we make the language *as safe as it currently is* 
> represents an attempt to "make this a managed language", and so forth. 
> You're basically saying that your design is perfect as is, and anyone who 
> questions it in the name of safety is "desperately try[ing] to divorce the 
> language from its low-level origins."
>
> Seriously, are you *five-years old*?
>
> And let's not forget the implied insult to the standards committee that 
> their design for move support is wrong because it actually includes such 
> safety features.
>
> Personally, my basic criticism of your proposal is that it's not even 
> really half of a proposal. You can only "relocate" objects who's lifetimes 
> are governed by `new/delete` or placement new/explicit destructor calls. 
> That is, not automatic objects. You're basically taking the *easy part* 
> of destructive move/relocation, and then pretending that you have a 
> complete "relocation" feature.
>
> If your relocation support can't even perform relocation in this most 
> simple of cases:
>
> std::list<T> SomeFunc()
> {
>   std::list<T> lt = ...
>   ...
>   return lt; //Insert syntax for relocation-returning, if needed
> }
>
> Then *what good is it*?
>
> In fact, there is *no way* in your proposal to relocate an object into a 
> return value. Not even with P0135's guaranteed elision mechanics. Since you 
> can only relocate an object through the use of `new`, and return values 
> aren't created by `new`, there is no way to use relocation on simple return 
> values.
>
> So again, *what good is this?*
>
> That's where the "safety" argument that Sean is making comes from. Your 
> proposal only works with features that are inherently unsafe and that 
> programmers increasingly do not use with any particular frequency. Unlike 
> `move`, which works on *all object*s, automatic and non-automatic alike.
>
> That's the basic point that Sean is (or seems to be) making about your 
> proposal. You cannot use your proposal without calling upon deep-magic 
> levels of C++, like placement new and so forth. Your features is brittle, 
> incomplete, and painful to use.
>
> Allow me to restate your asinine "scalpel" analogy/conversation to better 
> explain this:
>
> Surgeon: I propose this new scalpel, which does these things better than 
>> the old scalpel.
>> Committee: But it doesn't do things better than the old scalpel. It 
>> doesn't even work most of the time.
>> Surgeon: Sure it does. See, it works just fine if you stand on your head, 
>> and it does things even better than the old one.
>> Committee: But... most people stopped performing surgery while standing 
>> on their head years ago.
>> Surgeon: Isn't it up to the surgeon to decide how he wants to perform 
>> surgery?
>> Committee: That's old style thinking. In modern surgery, we want tools 
>> that work with how we actually operate on people, not tools that force us 
>> to operate in a specific way. Especially ones known to be bad.
>> Surgeon: But the old scalpel has no such protections either. The old 
>> scalpel is just... a scalpel.
>> Committee: That's not true at all. The old scalpel works just fine when 
>> standing normally.
>> Surgeon: How would we even design a scalpel that does what this does 
>> without having to stand on your head?
>> Committee: Put some effort into it, rather than doing the bare minimum 
>> that you feel you can get away with. Make a *complete* scalpel.
>>
>
> In this analogy, "stand on your head" mean "using new/delete or placement 
> new and explicit destructor calls".
>
> Indeed, it's not clear to me why it is that your proposal needs to be a 
> language feature at all. N4034 was able to do what you're talking about 
> purely as a standard library thing. All it would need to do is say that the 
> function ends the lifetime of the source object, and that the source object 
> must not be an automatic object.
>
> You can even have implicitly generated versions which will simply perform 
> a move from the source to the destination, followed by a destructor call on 
> the source. It would be deleted for any type `T` who's move constructor is 
> not `noexcept`.
>
 
 I think biggest problem is trying to shoehorn destructive move to object 
with custom destructor. We already have types that have "destructive move", 
there are PODs. They need wrapper that manage lifetime of data from 
internal object. Great example of this is `unique_ptr` that manage raw 
pointer. We could even expand this to `unique_vector` that will manage 
array of unique pointers. Extracting one pointer from it will only need one 
`memmove` operation, inserting new will need only this too.

I think that is possible to create today library that will handle that kind 
of types:

struct pod
{
    int x, y;
    friend void init(pod*); //pseudo constructor
    friend void destroy(pod*); //pseudo destructor
    friend void move(pod*, pod*); //pseudo copy constructor, if not find 
library use memcopy
};

template<typename P>
class Warper
{
    static_assert(std::is_pod<P>(), "Type need to be POD");
    P p;
public:
    Warper() : p{} { init(&p); }
    ~Warper() { destroy(&p); }
};
template<typename> class Warper_vector;
template<typename P>
class Warper_movable
{
    static_assert(std::is_pod<P>(), "Type need to be POD");
    friend class Warper_vector<P>;
    bool empty;
    P p;
public:
    Warper_movable() : empty{false}, p{} { init(&p); }
    Warper_movable(Warper_movable&& r) : empty{false}, p{} { move(&r.p, &p); 
r.empty = true; }
    ~Warper_movable() { if (!empty) destroy(&p); }
};
template<typename P>
class Warper_vector
{
    static_assert(std::is_pod<P>(), "Type need to be POD");
    std::vector<P> v;
public:
    Warper_vector() : v(10) { for (auto& p : v) init(&p); }
    ~Warper_vector() { for (auto& p : v) destroy(&p); }

    void push_back(Warper_movable<P>&& r)
    {
        v.push_back(r.p); //no destructors or constructors calls
        r.empty = true; //we can now optimalzie out `Warper_movable` call 
to `destroy`.
    }
};

int main()
{
    Warper_vector<pod> vec;
    for (int i = 0; i < 10; ++i)
    {
        Warper_movable<pod> obj;
        vec.push_back(std::move(obj));
    }
} //`init` and `destroy` is call 20 times





-- 
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/42c08c4f-dae2-4705-922b-a1ddf8ca7839%40isocpp.org.

------=_Part_1047_829198281.1460141502508
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Friday, April 8, 2016 at 4:12:03 PM UTC+2, Nico=
l Bolas wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-l=
eft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"=
>On Friday, April 8, 2016 at 2:07:17 AM UTC-4, <a>isocp...@denisbider.com</=
a> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.=
8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>Ah, =
Jesus.</div><div><br></div><div>It seems to me C++ has become infested with=
 people=C2=A0who call themselves &quot;modern&quot;, but whose=C2=A0objecti=
ve is to=C2=A0desperately try to divorce=C2=A0the language=C2=A0from its lo=
w-level origins, while=C2=A0ashamedly having to=C2=A0recognize that this ca=
nnot be done, because it would defeat the purpose of the language and make =
it useless for its primary role.</div><div><br></div><div>You are now build=
ing this over-ambitious standard library monstrosity, which is=C2=A0trying =
to pretend that C++ can be a platform. But the=C2=A0role of C++ is not to <=
i>be</i> a platform. It is a tool for <i>building</i> platforms, and for bu=
ilding applications on top of existing platforms.</div><div><br></div><div>=
I can honestly say I don&#39;t like what you&#39;re doing, and if you keep =
going in this direction, C++ will have to be replaced with something that s=
erves its original purpose.</div><div><br></div><div>Stop trying to make th=
is a managed language, for god&#39;s sake.</div></div></blockquote><div><br=
>... So Sean points out how move support introduced a plethora of new value=
 categories in order to ensure that it does not get automatically used in t=
he wrong place. To make sure that it&#39;s reasonably safe and usable for m=
ost programmers. And he suggests that you should investigate this sort of t=
hing as a way to make sure that your &quot;relocation&quot; is also reasona=
bly safe, that it gets used automatically where appropriate, and that it do=
esn&#39;t get used in improper places. And so forth.<br><br>And your respon=
se to this is <a href=3D"https://en.wikipedia.org/wiki/Ad_hominem" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://www.go=
ogle.com/url?q\75https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FAd_hominem\46sa\75=
D\46sntz\0751\46usg\75AFQjCNG-BwifY9ygNjAtJUGk8AHKdjZJiQ&#39;;return true;"=
 onclick=3D"this.href=3D&#39;https://www.google.com/url?q\75https%3A%2F%2Fe=
n.wikipedia.org%2Fwiki%2FAd_hominem\46sa\75D\46sntz\0751\46usg\75AFQjCNG-Bw=
ifY9ygNjAtJUGk8AHKdjZJiQ&#39;;return true;">to claim that such commentary c=
omes from people</a> who are &quot;infesting&quot; the language, that even =
that we make the language <i>as safe as it currently is</i> represents an a=
ttempt to &quot;make this a managed language&quot;, and so forth. You&#39;r=
e basically saying that your design is perfect as is, and anyone who questi=
ons it in the name of safety is &quot;desperately try[ing] to divorce=C2=A0=
the language=C2=A0from its low-level origins.&quot;<br><br>Seriously, are y=
ou <i>five-years old</i>?<br><br>And let&#39;s not forget the implied insul=
t to the standards committee that their design for move support is wrong be=
cause it actually includes such safety features.<br><br>Personally, my basi=
c criticism of your proposal is that it&#39;s not even really half of a pro=
posal. You can only &quot;relocate&quot; objects who&#39;s lifetimes are go=
verned by `new/delete` or placement new/explicit destructor calls. That is,=
 not automatic objects. You&#39;re basically taking the <i>easy part</i> of=
 destructive move/relocation, and then pretending that you have a complete =
&quot;relocation&quot; feature.<br><br>If your relocation support can&#39;t=
 even perform relocation in this most simple of cases:<br><br><div style=3D=
"background-color:rgb(250,250,250);border-color:rgb(187,187,187);border-sty=
le:solid;border-width:1px;word-wrap:break-word"><code><div><span style=3D"c=
olor:#000">std</span><span style=3D"color:#660">::</span><span style=3D"col=
or:#000">list</span><span style=3D"color:#660">&lt;</span><span style=3D"co=
lor:#000">T</span><span style=3D"color:#660">&gt;</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#606">SomeFunc</span><span style=3D"co=
lor:#660">()</span><span style=3D"color:#000"><br></span><span style=3D"col=
or:#660">{</span><span style=3D"color:#000"><br>=C2=A0 std</span><span styl=
e=3D"color:#660">::</span><span style=3D"color:#000">list</span><span style=
=3D"color:#660">&lt;</span><span style=3D"color:#000">T</span><span style=
=3D"color:#660">&gt;</span><span style=3D"color:#000"> lt </span><span styl=
e=3D"color:#660">=3D</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">...</span><span style=3D"color:#000"><br>=C2=A0 </span><spa=
n style=3D"color:#660">...</span><span style=3D"color:#000"><br>=C2=A0 </sp=
an><span style=3D"color:#008">return</span><span style=3D"color:#000"> lt</=
span><span style=3D"color:#660">;</span><span style=3D"color:#000"> </span>=
<span style=3D"color:#800">//Insert syntax for relocation-returning, if nee=
ded</span><span style=3D"color:#000"><br></span><span style=3D"color:#660">=
}</span></div></code></div><br>Then <i>what good is it</i>?<br><br>In fact,=
 there is <i>no way</i> in your proposal to relocate an object into a retur=
n value. Not even with P0135&#39;s guaranteed elision mechanics. Since you =
can only relocate an object through the use of `new`, and return values are=
n&#39;t created by `new`, there is no way to use relocation on simple retur=
n values.<br><br>So again, <i>what good is this?</i><br><br>That&#39;s wher=
e the &quot;safety&quot; argument that Sean is making comes from. Your prop=
osal only works with features that are inherently unsafe and that programme=
rs increasingly do not use with any particular frequency. Unlike `move`, wh=
ich works on <i>all object</i>s, automatic and non-automatic alike.<br><br>=
That&#39;s the basic point that Sean is (or seems to be) making about your =
proposal. You cannot use your proposal without calling upon deep-magic leve=
ls of C++, like placement new and so forth. Your features is brittle, incom=
plete, and painful to use.<br><br>Allow me to restate your asinine &quot;sc=
alpel&quot; analogy/conversation to better explain this:<br><br><blockquote=
 style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex" class=3D"gmail_quote">Surgeon: I propose this new scalpel,=
 which does these things better than the old scalpel.<br>Committee: But it =
doesn&#39;t do things better than the old scalpel. It doesn&#39;t even work=
 most of the time.<br>Surgeon: Sure it does. See, it works just fine if you=
 stand on your head, and it does things even better than the old one.<br>Co=
mmittee: But... most people stopped performing surgery while standing on th=
eir head years ago.<br>Surgeon: Isn&#39;t it up to the surgeon to decide ho=
w he wants to perform surgery?<br>Committee: That&#39;s old style thinking.=
 In modern surgery, we want tools that work with how we actually operate on=
 people, not tools that force us to operate in a specific way. Especially o=
nes known to be bad.<br>Surgeon: But the old scalpel has no such protection=
s either. The old scalpel is just... a scalpel.<br>Committee: That&#39;s no=
t true at all. The old scalpel works just fine when standing normally.<br>S=
urgeon: How would we even design a scalpel that does what this does without=
 having to stand on your head?<br>Committee: Put some effort into it, rathe=
r than doing the bare minimum that you feel you can get away with. Make a <=
i>complete</i> scalpel.<br></blockquote><div><br>In this analogy, &quot;sta=
nd on your head&quot; mean &quot;using new/delete or placement new and expl=
icit destructor calls&quot;.<br><br>Indeed, it&#39;s not clear to me why it=
 is that your proposal needs to be a=20
language feature at all. N4034 was able to do what you&#39;re talking about=
=20
purely as a standard library thing. All it would need to do is say that=20
the function ends the lifetime of the source object, and that the source
 object must not be an automatic object.<br><br>You can even have implicitl=
y generated versions which will simply perform a move from the source to th=
e destination, followed by a destructor call on the source. It would be del=
eted for any type `T` who&#39;s move constructor is not `noexcept`.<br></di=
v></div></div></blockquote><div>=C2=A0</div><div>=C2=A0I think biggest prob=
lem is trying to <span data-dobid=3D"hdw">shoehorn destructive move to obje=
ct with custom destructor. We already have types that have &quot;destructiv=
e move&quot;, there are PODs. They need wrapper that manage lifetime of dat=
a from internal object. Great example of this is `unique_ptr` that manage r=
aw pointer. We could even expand this to `unique_vector` that will manage a=
rray of unique pointers. Extracting one pointer from it will only need one =
`memmove` operation, inserting new will need only this too.<br><br>I think =
that is possible to create today library that will handle that kind of type=
s:<br><br><div class=3D"prettyprint" style=3D"background-color: rgb(250, 25=
0, 250); border-color: rgb(187, 187, 187); border-style: solid; border-widt=
h: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"s=
ubprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prettify">st=
ruct</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> pod<b=
r></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 =C2=A0=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">int</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> y</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #00=
8;" class=3D"styled-by-prettify">friend</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> init</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
pod</span><span style=3D"color: #660;" class=3D"styled-by-prettify">*);</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #800;" class=3D"styled-by-prettify">//pseudo constructor</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">fri=
end</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">void</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> destroy</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify">pod</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">*);</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">//pseudo destructor</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: =
#008;" class=3D"styled-by-prettify">friend</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> move</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">pod</span><span style=3D"color: #660;" class=3D"styled-by-prettify">*,<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> pod</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">*);</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #800;" class=3D"styled-by-prettify">//pseudo copy constructor, if not=
 find library use memcopy</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">};</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">t=
emplate</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt=
;</span><span style=3D"color: #008;" class=3D"styled-by-prettify">typename<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> P</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">class</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #606;"=
 class=3D"styled-by-prettify">Warper</span><span style=3D"color: #000;" cla=
ss=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 =C2=A0 </span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">static_assert</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">std</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
is_pod</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify">P</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">&gt;(),</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #080;" class=3D"styled-by-prettify">&quot;Type need to be POD&quot;=
</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 =C2=A0 =
P p</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: #008;" class=3D"styled-by-prettify">public</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #606;" class=3D"styled-by-prettify">Warper</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> p</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">{}</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"> init</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify">p</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">~</span><span style=3D"color: #606;" class=3D"style=
d-by-prettify">Warper</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> destroy</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">p</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"colo=
r: #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"><br></span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">};</span><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>template</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&=
lt;typename&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">clas=
s</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #606;" class=3D"styled-by-prettify">Warper_vector</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">typename</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> P</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">&gt;</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">class</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Warper_movable</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">static_assert</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">st=
d</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify">is_pod</span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">&lt;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify">P</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">&gt;(),</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #080;" cl=
ass=3D"styled-by-prettify">&quot;Type need to be POD&quot;</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">friend</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">class</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D=
"styled-by-prettify">Warper_vector</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify">P</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&gt;;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-b=
y-prettify">bool</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> empty</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 =C2=A0 P p</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #008;" class=3D"styled-by-prettify">public</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span=
><span style=3D"color: #606;" class=3D"styled-by-prettify">Warper_movable</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span><sp=
an 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"> empty</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">{</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">false</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">},</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> p</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">{}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> init</span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify">p</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #606;" class=3D"sty=
led-by-prettify">Warper_movable</span><span style=3D"color: #660;" class=3D=
"styled-by-prettify">(</span><span style=3D"color: #606;" class=3D"styled-b=
y-prettify">Warper_movable</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">&amp;&amp;</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> r</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"> empty</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"=
color: #008;" class=3D"styled-by-prettify">false</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">},</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> p</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{}</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> m=
ove</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(&amp;<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify">r</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">p</span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify">p</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">);</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> r=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">empty </span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #008;" class=3D"styled-by-prettify">true</span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">~</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Warper_movable</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">()</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"> </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">if</span><span style=3D"co=
lor: #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">empty</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> destroy</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy">p</span><span style=3D"color: #660;" class=3D"styled-by-prettify">);</s=
pan><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"><br></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: #008;" class=
=3D"styled-by-prettify">template</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">typename</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> P</span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">clas=
s</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><=
span style=3D"color: #606;" class=3D"styled-by-prettify">Warper_vector</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><sp=
an style=3D"color: #008;" class=3D"styled-by-prettify">static_assert</span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify">is_pod</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify">P</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&gt;(),</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #080;" class=3D"styled-by-prettif=
y">&quot;Type need to be POD&quot;</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify">vector</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify">P</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
&gt;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> v</sp=
an><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: #008;" class=3D"styled-by-prettify">public</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"c=
olor: #606;" class=3D"styled-by-prettify">Warper_vector</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">()</span><span style=3D"colo=
r: #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"> v</span><span style=3D"color: #660;" class=3D"styled-=
by-prettify">(</span><span style=3D"color: #066;" class=3D"styled-by-pretti=
fy">10</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</s=
pan><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"> </span><span style=3D"color: #=
008;" class=3D"styled-by-prettify">for</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">auto</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
p </span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> v</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> init</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">(&amp;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">p</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><b=
r>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">~</span><span style=3D"color: #606;" class=3D"styled-by-prettify">War=
per_vector</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"col=
or: #008;" class=3D"styled-by-prettify">for</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">auto</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&amp;</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> p </span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> v</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> destroy</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">(&amp;</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">p</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"><br><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"=
styled-by-prettify">void</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> push_back</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">(</span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Warper_movable</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y">P</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;&a=
mp;&amp;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> r=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 <=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 v</span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">.</span><span style=3D"color: #000;" class=3D"styled-by-prettify">push=
_back</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">r</span><span =
style=3D"color: #660;" class=3D"styled-by-prettify">.</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify">p</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"sty=
led-by-prettify">//no destructors or constructors calls</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 r</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify">empty </span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">true</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"sty=
led-by-prettify">//we can now optimalzie out `Warper_movable` call to `dest=
roy`.</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">};</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br><br></span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> main</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #606;" cl=
ass=3D"styled-by-prettify">Warper_vector</span><span style=3D"color: #080;"=
 class=3D"styled-by-prettify">&lt;pod&gt;</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> vec</span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">for</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">i=
nt</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> i </spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #066;" class=3D"styled-by-prettify">0</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> i </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">&lt;</span><span style=3D"color: #000;" class=3D"styled-=
by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-pretti=
fy">10</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</s=
pan><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">i</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 =C2=A0 </span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span st=
yle=3D"color: #606;" class=3D"styled-by-prettify">Warper_movable</span><spa=
n style=3D"color: #080;" class=3D"styled-by-prettify">&lt;pod&gt;</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> obj</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 vec=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify">push_back</span><sp=
an style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">std</span><span style=3D"col=
or: #660;" class=3D"styled-by-prettify">::</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify">move</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">(</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify">obj</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">));</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"><br>=C2=A0 =C2=A0 </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">}</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #800;" class=3D"styled-by-prettify">//`init` and `destroy`=
 is call 20 times</span></div></code></div><br><br><br><br><br></span></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/42c08c4f-dae2-4705-922b-a1ddf8ca7839%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/42c08c4f-dae2-4705-922b-a1ddf8ca7839=
%40isocpp.org</a>.<br />

------=_Part_1047_829198281.1460141502508--
------=_Part_1046_1148487956.1460141502506--

.
