220 38233 <CALvx3haxYiRPejcW3TqvCWcD9RRm+qZcz2F6vcVMVBx3PDJF2w@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Richard Hodges <hodges.r@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Simple, terse universal forwading for the
 next decade
Date: Mon, 28 May 2018 16:53:56 +0200
Lines: 369
Approved: news@gmane.org
Message-ID: <CALvx3haxYiRPejcW3TqvCWcD9RRm+qZcz2F6vcVMVBx3PDJF2w@mail.gmail.com>
References: <80548757-8a42-499a-bf15-3670b2727082@isocpp.org>
 <8d3b34de-c06a-4083-bb0c-8e2c7482abf0@isocpp.org> <9930a9dc-b998-4431-a159-6d72d1d9b2ff@isocpp.org>
 <CALmDwq2ku8=UX1XYGtroNQ5nUCZ6HvSN9TDSmrdg4S+YOU0R1A@mail.gmail.com>
 <8e1c6607-a92d-496b-aad1-e992e049a748@isocpp.org> <CALmDwq1CpLZJMFiY1-3Nk-bq+686h2g7rdT6JcSpSg6yYu39zg@mail.gmail.com>
 <2f782c2d-e89c-4d8b-8ef6-372c00e62ab1@isocpp.org> <93ee46a2-1469-48ae-b931-c060946f38d5@isocpp.org>
 <609892ba-f717-4458-b9e3-c5975378ad29@isocpp.org> <CAANG=kUqV_OU+XTZpgMg3LJo_EH1P9CMWVXi+ZUx4aa-mcH54g@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000002a1c85056d454aa6"
X-Trace: blaine.gmane.org 1527519124 22777 195.159.176.226 (28 May 2018 14:52:04 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 28 May 2018 14:52:04 +0000 (UTC)
Cc: mihailnajdenov@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBD4PBM7UWAHRBEFQWDMAKGQE5MGIMLA@isocpp.org Mon May 28 16:52:00 2018
Return-path: <std-proposals+bncBD4PBM7UWAHRBEFQWDMAKGQE5MGIMLA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-io0-f198.google.com ([209.85.223.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBD4PBM7UWAHRBEFQWDMAKGQE5MGIMLA@isocpp.org>)
	id 1fNJV8-0005mG-PY
	for gclcip-std-proposals@m.gmane.org; Mon, 28 May 2018 16:51:59 +0200
Original-Received: by mail-io0-f198.google.com with SMTP id q24-v6sf10831430iob.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 28 May 2018 07:54:10 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1527519249; cv=pass;
        d=google.com; s=arc-20160816;
        b=scsx8OGlGqOI3GZO0EIX8FBRaY8ZJxrrUUqr/rYIm1kvHhsNXdPIOLc51O/NNKe3a5
         P/y0f344v6eSnZrRs/iyBy+ijcI2gidGOHEqJSIkS9LxO7ZyFs/eN+1TJbzIqPeNRBbV
         pavQRQzE1WXj15Lq0o6pv+1++o0wAMmMg85618NimV/lB5fwz4VrN+D+F+DDy6FQkEYp
         bGpWN4WsbORRiY32oLfRjq7eczI5H8l1PGkiBDbfAMPLwiCA+chyfB30WbdpQhXS6/0p
         nT0gfE7nbfhLyv+zzdiefeyH0NHJe60GmGVPbexYtoX3b3Sq9IkZmmqBYv2gBPiKrWe1
         i/hg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:cc:to:subject:message-id
         :date:from:in-reply-to:references:mime-version
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=xYMadlFc/Kk0//MvyEO+T7AArnPgorqtl5IUtSeqfo8=;
        b=kiIxByEoD5aUCIsinQJmgz/SLbozSvlak6C2jJyNKvo/Z0H8RQJv8K/tgeWUnORZsN
         MpuYIl36ZoplAjSFfCxCKzWUH3TSEcFG0B0dcDk/e0jSv0joys0O1k50JivLLtZxNocR
         ZC/uO07Hkcnh0GuKJpPzv8SnSuxVo+5XFjhP+Y9TEmsp7WiWezbqYhBkyZ7tEvWqRs84
         S5ujIZZ59tplKWxi9c41r6nAzfXqrtT4xZrGPENlu79kPRTn8LhjRKuB0638uw6xqYVj
         t5WRetycKQzPHphinAyK0yfgxfMwKWlcEvLGvXgwZvrOH9HIRToy1+30TetFoE637jFB
         fdlA==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=IpFDHqTf;
       spf=pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hodges.r@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to
         :cc:x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=xYMadlFc/Kk0//MvyEO+T7AArnPgorqtl5IUtSeqfo8=;
        b=oRt4OAF+yBqvTTRVMuxB+SQPhWmWw/yw1/SjDWLtpILq8QfJ4WRrrbXBWp9L1Kj++Z
         /GAsIW21DT50LguplH5GDQ24/KfpCucBe1u9Wlb+TOSbYjx6fgO1Iuk26LH83ar0Qsiv
         6SfjC6UDeO+BRjk9bqTsaz2A7toc3qLAo4Nwk97M2/KrCQg1prEs6pbWboXu0Ydo/LRh
         MEaRroo5UHyhsgpQJ5JsgxXQXXTe58KahTC4GKR3Nyq31yJXvRyGy/iy1J+l4TQ2IxCo
         LKwyKSi+n03ExmO16oJ5fLN7jrUfFA428pg33h3fWkmgHy16cxIT0rgOiq1xOQHrUrAj
         EJ9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc: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=xYMadlFc/Kk0//MvyEO+T7AArnPgorqtl5IUtSeqfo8=;
        b=S8jIw9RBxVRjvklspiy3WV1nn/S1kPqfOpq+cSZ0FRwRrs0Mp7FNsoq47SrnZfIEIS
         oAwvqW1X1kp2fdcHntXDkTkQLDdbklCB8VSJ0ClsEee0Imur8fTcQLQ0lBMZ4NbqWGXE
         3O4qedECelizqbasDILVgkB2q1+jVp4zjksgM5cLo/brzUOF8LO1JemSa1Q7PYeYdu11
         Fnci/O9gjoaSoA42SoFwMAjOxCoFFk+pKPr+nwxUM1daFgNssGIysBE4BTaurZ+Ax3ID
         nKLBHhQUeBF0GSLgFzO+oyuTfQDMe5AFQiKjJu5skTAToYh3Os/lAUdlnpg2Jqv/OJdV
         XmYA==
X-Gm-Message-State: ALKqPwc3gktN9hsCZKxcyFuz/9pACG8RmvCHcbzKh7Kx2fTWyV/BVNwW
	IIv0zWiRmE/Ai6O9nn8b6NEdpw==
X-Google-Smtp-Source: ADUXVKLG3s5VjNUifp90a31P33SMb4km/LEB/USoHFwQTxLIYK9mAf9SHJ2N0/9O5ckiOWojg2AgqQ==
X-Received: by 2002:a6b:e610:: with SMTP id g16-v6mr6373924ioh.122.1527519249518;
        Mon, 28 May 2018 07:54:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a24:784b:: with SMTP id p72-v6ls5616074itc.1.canary-gmail;
 Mon, 28 May 2018 07:54:08 -0700 (PDT)
X-Received: by 2002:a24:a104:: with SMTP id y4-v6mr12011081ite.68.1527519248383;
        Mon, 28 May 2018 07:54:08 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1527519248; cv=none;
        d=google.com; s=arc-20160816;
        b=GaWtJWWSJ0JEj9AYs6VYDzjO4IHCK56Shf7qsqwOW4ot2IGay2pZ++6aJDhF4r8ys5
         +YxVo1vix6x0YzzQQBiVIq4I7CjngJFI1Ie3t5Mra8EapE6ja/fEyM+oNDXtQ6klVwXe
         MBQF+IWXyUDIrVZxmWrg3fLA3h2E9lyeoSKEqJgRUnnZvLF9fxvV3yu3D7RCn2Qc1RlX
         8hvQSE/bFYxOoKQSZNJ1eTk569gMeC40epDFGD00GJrU+nYbyVqxH+KUxi25oNV064Dm
         fYkZjxlQbnaCL0dqt6la2QEGwkKLRe59IjFqJ1moki50Is8HNWhFmvLbGvOf7MKLoVUr
         iryg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature:arc-authentication-results;
        bh=9xuKhVh44i/olZHLFjfxon6rOSyxyNDmIRyUeDvI1zo=;
        b=BbVFzN8EUqZ1TWC9MEqVaN6XimR2+UNta6PL6lmTdpqR1nTatD1aR61VryeN6pdNnd
         DOk9Sjf05jfAjEO07Rs7csWtZw1l7zEi/hULjmteALFfU7OBpfH28w9s90pPTp/ccg4R
         5uZoDfiakjBkqOBGezhhlbKkX4VqJw8VZM+j75fCIQ98p/+Ntl++vyJ1NVFx9UlTbDal
         kfYV7EQjEg+K+suByPqLToVPZoo5mOey3Bt6wvRb9ULDCwXpOqndwk+7XGBcEuqPQwMr
         gCdR2unsbb34s0zC4NeXhDWcv+5i/t0EP6vmza8gZcC7sTgQ0FBw1+P925CG10cYCLpB
         6EGg==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=IpFDHqTf;
       spf=pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=hodges.r@gmail.com;
       dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com
Original-Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41])
        by mx.google.com with SMTPS id i131-v6sor2645927iof.119.2018.05.28.07.54.08
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Mon, 28 May 2018 07:54:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 2002:a6b:5110:: with SMTP id f16-v6mr11061041iob.118.1527519247995;
 Mon, 28 May 2018 07:54:07 -0700 (PDT)
In-Reply-To: <CAANG=kUqV_OU+XTZpgMg3LJo_EH1P9CMWVXi+ZUx4aa-mcH54g@mail.gmail.com>
X-Original-Sender: hodges.r@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=IpFDHqTf;       spf=pass
 (google.com: domain of hodges.r@gmail.com designates 209.85.220.41 as
 permitted sender) smtp.mailfrom=hodges.r@gmail.com;       dmarc=pass (p=NONE
 sp=QUARANTINE 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:38233
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38233>

--0000000000002a1c85056d454aa6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

> *Motivation to merge forward and move (not in order):*

I think it's clear that the committee is already in agreement with you. The
only objections previously seemed to be that an operator was proposed.

For the record, I also agree with you. A language should allow a programmer
to express intent succinctly. give() would help c++ with that.

On Mon, 28 May 2018 at 13:56, Ga=C5=A1per A=C5=BEman <gasper.azman@gmail.co=
m> wrote:

> And one last thing
>> One way to look at it is - *it is just a form of overloaded operator*,
>> and overloaded operators are a cornerstone of C++
>> It has two "overloads"
>>  - for forwarding reference - In that case it will expand to forward (or
>> static_cast<T&&> or whatever)
>>  - for everything else - In that case it will expand to move (or
>> static_cast<remove_reference_t<T>&&> or whatever)
>> Such an operator (or overload) is not possible today, so we need compile=
r
>> support.
>
>
> It is *not* a form of an overloaded operator - the operator is always
> invoked on an lvalue, and whether it's a forwarding reference depends not
> on its type, but on *whether the value-category was deduced in the
> current context*. We have absolutely no precedent for this. You need a
> different abstraction.
>
> I'd love to see a `forward` operator that would let me omit the
> <decltype(foo)>(foo). I see your point wrt. move and forward being the
> same, because in either case, you can't use the value afterwards (because
> you must always program to the more restrictive contract, which in case o=
f
> forward means the move part). *give* makes sense, ish. But, please don't
> confuse it for an operator. It's a context-sensitive thing of a category =
we
> just haven't ever had.
>
> G
>
>
> On Mon, May 28, 2018 at 8:27 AM, <mihailnajdenov@gmail.com> wrote:
>
>>
>>
>> On Sunday, May 27, 2018 at 11:39:01 PM UTC+3, Nicol Bolas wrote:
>>>
>>> On Sunday, May 27, 2018 at 3:05:10 PM UTC-4, mihailn...@gmail.com wrote=
:
>>>>
>>>> So the question still stands:
>>>>
>>>> Is there a *valid* reason to move a forwarding reference? Is there a
>>>> *need* for this?
>>>>
>>> If there is a need, then move can be preserved and used instead.
>>>> If there is no need, move *could* be deprecated.
>>>>
>>>> Question 2: Should one ever use forward *instead of* move?
>>>>
>>>> Question 3: Will give ever result in ambiguity in code? As in human
>>>> confusion or uncertainty of what is happening?
>>>>
>>>> Question 4. Is it possible to implement?
>>>>
>>>> I believe the answers of these 4 questions make the said proposal a
>>>> good improvement to the language.
>>>>
>>>
>>> I believe these questions are backwards. Your questions are about
>>> validating the proposal, not *motivating* it. Basically, you're asking
>>> "why not" rather than "why".
>>>
>>> "Why" is the question your proposal needs to answer.
>>>
>>
>>
>> Let me answer this.
>>
>> *Motivation to merge forward and move (not in order):*
>>
>>  1. Less of the "C++ is experts only".
>> Removing the distinction (*on a practical, hands down level)* will make
>> the language more friendly do beginners.
>> The distinction is subtle and not initially clear, where if merged, when
>> the user sees && on a type, he will know, he needs to use the matching
>> operator.
>> Always. Always the same!
>>
>>  2. Better code.
>> Eliminating the possibility to get it wrong - to use one in the place of
>> the other will make for less bugs, easier maintenance, easier refactor.
>>
>>  3. The compiler should do the job for us.
>> If there are *no decisions* to be made on the part of the programmer, he
>> is not really coding logic, not really "programming" - only truckling to
>> the language.
>>
>>  4. Merger will make it way, way easier to came up with operator.
>> Both move and forward should be an operator, not just because verbosity,
>> but because they are integral part of the language, not a library add-on
>> and a wildly used (may be not even enough).
>> A language which has an operator to take the address of a variable, but
>> can not naturally express the notion of passing the said variable along,
>> definitely shows its age.
>>
>> (5.) It is actually good design.
>> Lets consider an orthogonal example.
>> One has two classes Image and File. Then the image has freeImageData()
>> method, the file has closeFileHandle() and the user is forced to spell o=
ut
>> each one for each object.
>> The sooner or later someone will come up with solution which trades the
>> explicitly of the methods for some base notion of finishing up with the
>> object.
>> Someone will invent some release() method.
>>
>> Here the things are similar - different preconditions, different actions=
,
>> but same base notion - passing along.
>>
>> And one last thing
>>
>> One way to look at it is - *it is just a form of overloaded operator*,
>> and overloaded operators are a cornerstone of C++
>> It has two "overloads"
>>  - for forwarding reference - In that case it will expand to forward (or
>> static_cast<T&&> or whatever)
>>  - for everything else - In that case it will expand to move (or
>> static_cast<remove_reference_t<T>&&> or whatever)
>>
>> Such an operator (or overload) is not possible today, so we need compile=
r
>> support.
>>
>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> 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/609892ba-f7=
17-4458-b9e3-c5975378ad29%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/609892ba-f=
717-4458-b9e3-c5975378ad29%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>
> --
> 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/CAANG%3DkUqV=
_OU%2BXTZpgMg3LJo_EH1P9CMWVXi%2BZUx4aa-mcH54g%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAANG%3DkUq=
V_OU%2BXTZpgMg3LJo_EH1P9CMWVXi%2BZUx4aa-mcH54g%40mail.gmail.com?utm_medium=
=3Demail&utm_source=3Dfooter>
> .
>

--=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/CALvx3haxYiRPejcW3TqvCWcD9RRm%2BqZcz2F6vcVMVBx3P=
DJF2w%40mail.gmail.com.

--0000000000002a1c85056d454aa6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">&gt;=C2=A0<b>Motivation to merge=C2=A0<font face=3D"courie=
r new,monospace">forward</font>=C2=A0and=C2=A0<font face=3D"courier new,mon=
ospace">move</font>=C2=A0(not in order):</b><br><br class=3D"gmail-Apple-in=
terchange-newline"><div>I think it&#39;s clear that the committee is alread=
y in agreement with you. The only objections previously seemed to be that a=
n operator was proposed.</div><div><br></div><div>For the record, I also ag=
ree with you. A language should allow a programmer to express intent succin=
ctly. <font face=3D"monospace, monospace">give()</font> would help c++ with=
 that.</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, 2=
8 May 2018 at 13:56, Ga=C5=A1per A=C5=BEman &lt;<a href=3D"mailto:gasper.az=
man@gmail.com">gasper.azman@gmail.com</a>&gt; wrote:<br></div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex"><div dir=3D"ltr"><blockquote style=3D"margin:0 0 0 40px;b=
order:none;padding:0px"><blockquote style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmail_quote"><=
/blockquote></blockquote><blockquote style=3D"margin:0 0 0 40px;border:none=
;padding:0px"></blockquote><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
">And one last thing<br>One way to look at it is -=C2=A0<i>it is just a for=
m of overloaded operator</i>, and overloaded operators are a cornerstone of=
 C++<br>It has two &quot;overloads&quot;=C2=A0<br>=C2=A0- for forwarding re=
ference - In that case it will expand to forward (or static_cast&lt;T&amp;&=
amp;&gt; or whatever)<br>=C2=A0- for everything else -=C2=A0<span style=3D"=
background-color:transparent;font-size:13px;font-variant-numeric:normal;fon=
t-variant-east-asian:normal;font-family:Arial,Helvetica,sans-serif">In that=
 case it will expand to move (or static_cast&lt;remove_reference_t&lt;T&gt;=
&amp;&amp;&gt; or whatever)<br></span>Such an operator (or overload) is not=
 possible today, so we need compiler support.=C2=A0</blockquote><div><br></=
div><div>It is <i>not</i>=C2=A0a form of an overloaded operator - the opera=
tor is always invoked on an lvalue, and whether it&#39;s a forwarding refer=
ence depends not on its type, but on <b>whether the value-category was dedu=
ced in the current context</b>. We have absolutely no precedent for this. Y=
ou need a different abstraction.</div><div><br></div><div>I&#39;d love to s=
ee a `forward` operator that would let me omit the &lt;decltype(foo)&gt;(fo=
o). I see your point wrt. move and forward being the same, because in eithe=
r case, you can&#39;t use the value afterwards (because you must always pro=
gram to the more restrictive contract, which in case of forward means the m=
ove part). <i>give</i>=C2=A0makes sense, ish. But, please don&#39;t confuse=
 it for an operator. It&#39;s a context-sensitive thing of a category we ju=
st haven&#39;t ever had.<br></div><div><br></div><div>G</div><div><br></div=
><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><blockquot=
e style=3D"margin:0px 0.8ex;border-left:1px solid rgb(204,204,204);border-r=
ight:1px solid rgb(204,204,204);padding-left:1ex;padding-right:1ex" class=
=3D"gmail_quote"></blockquote></blockquote><blockquote style=3D"margin:0 0 =
0 40px;border:none;padding:0px"><blockquote style=3D"margin:0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);border-right:1px solid rgb(204,204,204);p=
adding-left:1ex;padding-right:1ex" class=3D"gmail_quote"></blockquote></blo=
ckquote><blockquote style=3D"margin:0 0 0 40px;border:none;padding:0px"><bl=
ockquote style=3D"margin:0px 0.8ex;border-left:1px solid rgb(204,204,204);b=
order-right:1px solid rgb(204,204,204);padding-left:1ex;padding-right:1ex" =
class=3D"gmail_quote"></blockquote></blockquote><blockquote style=3D"margin=
:0 0 0 40px;border:none;padding:0px"><blockquote style=3D"margin:0px 0.8ex;=
border-left:1px solid rgb(204,204,204);border-right:1px solid rgb(204,204,2=
04);padding-left:1ex;padding-right:1ex" class=3D"gmail_quote"></blockquote>=
</blockquote></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote=
">On Mon, May 28, 2018 at 8:27 AM,  <span dir=3D"ltr">&lt;<a href=3D"mailto=
:mihailnajdenov@gmail.com" target=3D"_blank">mihailnajdenov@gmail.com</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><span><=
br><br>On Sunday, May 27, 2018 at 11:39:01 PM UTC+3, Nicol Bolas wrote:<blo=
ckquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-le=
ft:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">On Sunday, May 27, 201=
8 at 3:05:10 PM UTC-4, <a>mihailn...@gmail.com</a> wrote:<blockquote class=
=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr"><div>So the question still stands:<=
/div><div><br></div><div>Is there a <i>valid</i> reason to move a forwardin=
g reference? Is there a <i>need</i> for this?</div></div></blockquote><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-lef=
t:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div>If there is a need=
, then move can be preserved and used instead.</div><div>If there is no nee=
d, move <i>could</i> be deprecated.</div><div><br></div><div>Question 2: Sh=
ould one ever use forward <i>instead of</i> move?</div><div><br></div><div>=
Question 3: Will <font face=3D"courier new,monospace">give</font> ever resu=
lt in ambiguity in code? As in human confusion or uncertainty of what is ha=
ppening?</div><div><br></div><div>Question 4. Is it possible to implement?<=
br></div><div><br></div><div>I believe the answers of these 4 questions mak=
e the said proposal a good improvement to the language.</div></div></blockq=
uote><div><br></div><div>I believe these questions are backwards. Your ques=
tions are about validating the proposal, not <i>motivating</i> it. Basicall=
y, you&#39;re asking &quot;why not&quot; rather than &quot;why&quot;.</div>=
<div><br></div><div>&quot;Why&quot; is the question your proposal needs to =
answer.<br></div></div></blockquote><div><br></div><div><br></div></span><d=
iv>Let me answer this.</div><div><br></div><div><b>Motivation to merge <fon=
t face=3D"courier new,monospace">forward</font> and <font face=3D"courier n=
ew,monospace">move</font> (not in order):</b></div><div><b></b><b></b><br><=
/div><div>=C2=A01. Less of the &quot;C++ is experts only&quot;.=C2=A0</div>=
<div>Removing the distinction (<i>on a practical, hands down level)</i> wil=
l make the language more friendly do beginners.=C2=A0</div><div>The distinc=
tion is subtle and not initially clear, where if merged, when the user sees=
 <font face=3D"courier new,monospace">&amp;&amp;</font> on a type, he will =
know, he needs to use the matching operator.</div><div>Always. Always the s=
ame!<br></div><div><br></div><div>=C2=A02. Better code.=C2=A0</div><div>Eli=
minating the possibility to get it wrong - to use one in the place of the o=
ther will make for less bugs, easier maintenance, easier refactor.</div><di=
v><br></div><div>=C2=A03. The compiler should do the job for us.=C2=A0</div=
><div>If there are <i>no decisions</i> to be made on the part of the progra=
mmer, he is not really coding logic, not really &quot;programming&quot; - o=
nly truckling to the language.=C2=A0</div><div><br></div><div>=C2=A04. Merg=
er will make it way, way easier to came up with operator.</div><div>Both <f=
ont face=3D"courier new,monospace">move</font> and <font face=3D"courier ne=
w,monospace">forward</font> should be an operator, not just because verbosi=
ty, but because they are integral part of the language, not a library add-o=
n and a wildly used (may be not even enough).</div><div>A language which ha=
s an operator to take the address of a variable, but can not naturally expr=
ess the notion of passing the said variable along, definitely shows its age=
..</div><div><br></div><div>(5.) It is actually good design.</div><div>Lets =
consider an orthogonal example.=C2=A0</div><div>One has two classes Image a=
nd File. Then the image has freeImageData() method, the file has closeFileH=
andle() and the user is forced to spell out each one for each object.</div>=
<div>The sooner or later someone will come up with solution which trades th=
e explicitly of the methods for some base notion of finishing up with the o=
bject.=C2=A0</div><div>Someone will invent some release() method.</div><div=
><br></div><div>Here the things are similar - different preconditions, diff=
erent actions, but same base notion - passing along.</div><div><br></div><d=
iv>And one last thing</div><div><br></div><div>One way to look at it is - <=
i>it is just a form of overloaded operator</i>, and overloaded operators ar=
e a cornerstone of C++</div><div>It has two &quot;overloads&quot;=C2=A0</di=
v><div>=C2=A0- for forwarding reference - In that case it will expand to fo=
rward (or static_cast&lt;T&amp;&amp;&gt; or whatever)</div><div>=C2=A0- for=
 everything else -=C2=A0<span style=3D"display:inline!important;float:none;=
background-color:transparent;color:rgb(34,34,34);font-family:&quot;Arial&qu=
ot;,&quot;Helvetica&quot;,sans-serif;font-size:13px;font-style:normal;font-=
variant:normal;font-weight:400;letter-spacing:normal;text-align:left;text-d=
ecoration:none;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px">In that case it will expand to move (or static_cast&lt;remove_=
reference_t&lt;T&gt;&amp;&amp;&gt; or whatever)</span></div><div><br></div>=
<div>Such an operator (or overload) is not possible today, so we need compi=
ler support.=C2=A0</div></div><span>

<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" target=3D"_=
blank">std-proposals+unsubscribe@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></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/609892ba-f717-4458-b9e3-c5975378ad29%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/609892ba-f717-=
4458-b9e3-c5975378ad29%40isocpp.org</a>.<br>
</blockquote></div><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" target=3D"_=
blank">std-proposals+unsubscribe@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>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAANG%3DkUqV_OU%2BXTZpgMg3LJo_EH1P9CM=
WVXi%2BZUx4aa-mcH54g%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Df=
ooter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std=
-proposals/CAANG%3DkUqV_OU%2BXTZpgMg3LJo_EH1P9CMWVXi%2BZUx4aa-mcH54g%40mail=
..gmail.com</a>.<br>
</blockquote></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/CALvx3haxYiRPejcW3TqvCWcD9RRm%2BqZcz2=
F6vcVMVBx3PDJF2w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALvx3haxYiRPej=
cW3TqvCWcD9RRm%2BqZcz2F6vcVMVBx3PDJF2w%40mail.gmail.com</a>.<br />

--0000000000002a1c85056d454aa6--

.
