220 37147 <CAJnXXogM=Q_OUA2806gwbNtPiQ9f2G8KD49VOXteKB7UWKxUrw@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: John Yates <john@yates-sheets.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Range-based for: emplace construction of the range expression?
Date: Thu, 1 Mar 2018 08:55:40 -0500
Lines: 64
Approved: news@gmane.org
Message-ID: <CAJnXXogM=Q_OUA2806gwbNtPiQ9f2G8KD49VOXteKB7UWKxUrw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="94eb2c0cf7b41eac6205665a37eb"
X-Trace: blaine.gmane.org 1519912421 19389 195.159.176.226 (1 Mar 2018 13:53:41 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 1 Mar 2018 13:53:41 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDW2ZOHC5EGRBXUM4DKAKGQE7WU74OA@isocpp.org Thu Mar 01 14:53:37 2018
Return-path: <std-proposals+bncBDW2ZOHC5EGRBXUM4DKAKGQE7WU74OA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDW2ZOHC5EGRBXUM4DKAKGQE7WU74OA@isocpp.org>)
	id 1erOeP-0004PY-As
	for gclcip-std-proposals@m.gmane.org; Thu, 01 Mar 2018 14:53:37 +0100
Original-Received: by mail-ua0-f197.google.com with SMTP id k4sf3705844uad.13
        for <gclcip-std-proposals@m.gmane.org>; Thu, 01 Mar 2018 05:55:43 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1519912543; cv=pass;
        d=google.com; s=arc-20160816;
        b=0HHq921QyygwFVvUaoAexh8rRKB861dNO0NDGG25p/6F6NdVENViKCfL5IVmyTkJ1h
         vyFuMwpL3g7R4ite6V391BOQDTWea/zQ5A1IqcXSmXPguo+6xcaxkGM21LPcD4YJBp8K
         /HCyRkzU8Y8hSOMHR0eVkpjRbN/uGeiJoBjI8WRCFYYMJq7aCwsixysh4xczh3Mt5lkI
         +59rd68frwM5CpIYrfFtQzXlltluIUjaxyM7i/FOtXeNrne9v0SB522GkCTe/HjYzIjV
         kUcp1hCKOiDjEY2KSWCxY0rkVbRgcp2HVkPxZ52vtqW5b1wSgQlbS6imG8/ANYfdZLc/
         6lJQ==
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:to:subject:message-id:date
         :from:sender:mime-version:arc-authentication-results
         :arc-message-signature:arc-authentication-results;
        bh=vazaujiFh0AlkdmCQDzith7tFh8RpskVx4IOcjA1DQI=;
        b=fd6nRsdndk2ocISXRcGjrn9UKly3TxrsJ5/TTWbLHx+cmQRk1CzBWpNWlEco5jCrs5
         Ptmc/JsEGws10SdZJxkThlMjtOsl4mrFIUduUQAMVIRAYtSZVW6/BB1qqS6sM8c6/Oov
         MJb/ntkvfETgl3pR//xMRZTrgwpS4ifsP7DSzlsmSPOMoMNbhT6b0WEv/WLG3GgrSXVE
         BsR/CsPuAQmdehG5Ub3btyP9AIvIIgOILI9UkxZPzqPowc/7l4/XxL+Z8ItHWC6UV8HD
         0jHqhGVFfkZz+/WhS5pjP4brRjD5lc2mgCjmoo//kv4SPtNGQfIev2yj13svJtTsvPPU
         ZOvg==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=LPDgMpFc;
       spf=pass (google.com: domain of john.yates.sheets@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.yates.sheets@gmail.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:sender: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=vazaujiFh0AlkdmCQDzith7tFh8RpskVx4IOcjA1DQI=;
        b=kpHvlV3A3kTZgLNJJfTqYcLsxG2rfdCIRiTa9djq11Jvo0orEPus724pOVyzz2cKZk
         FlbI4wLLyQON7b6Oav3NG+fcaktZoNgnkOmaMf9vQ+q+RnKXtC0jRn22nnMyikUYTdC3
         vCLCb6cX84vZWga9O4qYENFaD7RCY+6NxZAcBVhbeDD7NBTx4SXy0hpjqMcZMJtNY6eS
         nlEVmxwKGAcDzdc8fP5uLu2/aSkXvzqeeb+O+2Xtm/GyFNwrcarcFW2ytARzrdt8ZFm1
         tbht+MJRMiwv042ZTtK0I0XnEoMZO5aaNKjFWlg/4LvFNAdl2djVOQp2gvL+HyE/Hs4G
         mNTg==
X-Gm-Message-State: APf1xPA7IO1LsnR2i/1M6eQnvtEdQoi9jjhlLKdl+WzPpGCsWfQXlHdC
	4rxjhiiXkKufW0lQqfrh2aE=
X-Google-Smtp-Source: AG47ELu769EqFmxs+yXtdjpQ6Nc5RIUukNf6S9CVnFKHGDzwjGq0M6Ob+y9lkZjG/paktok+X+DnYw==
X-Received: by 10.31.162.199 with SMTP id l190mr767238vke.73.1519912543075;
        Thu, 01 Mar 2018 05:55:43 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.19.231 with SMTP id n36ls791348uae.2.gmail; Thu, 01 Mar
 2018 05:55:42 -0800 (PST)
X-Received: by 10.176.89.69 with SMTP id o5mr1257954uad.192.1519912542037;
        Thu, 01 Mar 2018 05:55:42 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1519912542; cv=none;
        d=google.com; s=arc-20160816;
        b=AwgTyqEBOpCdjiWI1q+ZMF/SiCctGgIMaJxuFSwoKLFI9cvqhs9gftiYKHfuyD6htK
         +V6DdTXrR/0c+6pRjgSInAWcTCnkZ7FW5ILHVBqU9St0DtCtPOsj70F/5YLiFCcBqPi4
         ojmwaR/sT9gSgS8ENJq71+A+oOydQe836QpNjPR+T12rV7YVCeeKWUTcOZ1Rv7/Y2goM
         ZVWMFYg3iSqjIVq5nhrKg65FBztPXOU3p+lqOanPoBYGgmqHS5OVemHBlEpuIGIOrrvT
         rXXwyT/WEgZEnxpL/XP0PZ6OtAaGNGvBZSxhMvc4oOcKYcDK1JCmMcCwiTeXSDh0z919
         4UTg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:sender:mime-version:dkim-signature
         :arc-authentication-results;
        bh=LDSPkbjDjvwfvVVrMndW6QkHR+vFTz0WGyeLLqjuR+8=;
        b=jhPSFENFPiO+cjrswH3/QRY5D429Y5HbEhig+Hv4oibt2yMYa+6Uib126sWlB/CqfU
         ZaYH3OosrUDUiN3WepOC5pb71sQGw6F5PTHGpFoc0UImBmkC2uNewIWKq3omvVV8F5TU
         BVfpBOQDbD+7l0DAgVvTzsKlvQ5BHvNJ8TbaDk5MYQeE3nY+77BrRCCy2xaUeuGvaKQk
         e5bsV5n7N+bYA8xtAxVBM00ySMXc4iFFs5vchZMTePvfKTQjnpbHKTrxFvtqs6wkfTIJ
         qkncfeGLvLt1qhWhfEGdw+X6uL2w1ACSPbnCbHyi8vvHmzFC5JopwGIKTkWo1vbQPGIF
         X4VA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=LPDgMpFc;
       spf=pass (google.com: domain of john.yates.sheets@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=john.yates.sheets@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 u143sor1416401vkb.231.2018.03.01.05.55.41
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Thu, 01 Mar 2018 05:55:41 -0800 (PST)
Received-SPF: pass (google.com: domain of john.yates.sheets@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.31.100.10 with SMTP id y10mr1164733vkb.55.1519912541398;
 Thu, 01 Mar 2018 05:55:41 -0800 (PST)
Original-Sender: john.yates.sheets@gmail.com
Original-Received: by 10.31.155.65 with HTTP; Thu, 1 Mar 2018 05:55:40 -0800 (PST)
X-Original-Sender: john.yates.sheets@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=LPDgMpFc;       spf=pass
 (google.com: domain of john.yates.sheets@gmail.com designates 209.85.220.41
 as permitted sender) smtp.mailfrom=john.yates.sheets@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:37147
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37147>

--94eb2c0cf7b41eac6205665a37eb
Content-Type: text/plain; charset="UTF-8"

Recently I have written a class to be used as the range expression in
range-based for loops.  Buried 4 levels within my new class is a tiny leaf
object with RAII semantics.  I have been happily using that object
unchanged for years.

Now my new range class is causing me to have to add move semantics not only
to that tiny leaf class but also the 3 new classes layered above it.  As
best as I can tell this is triggered by the fact that throughout the
evolution of range-base for the expansion has always included
initialization the hidden range variable via assignment.  If the
range-expression is an invocation of a constructor then is there any reason
that the language could not mandate emplace construction?

/john

-- 
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/CAJnXXogM%3DQ_OUA2806gwbNtPiQ9f2G8KD49VOXteKB7UWKxUrw%40mail.gmail.com.

--94eb2c0cf7b41eac6205665a37eb
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:arial,he=
lvetica,sans-serif">Recently I have written a class to be used as the range=
 expression in range-based for loops.=C2=A0 Buried 4 levels within my new c=
lass is a tiny leaf object with RAII semantics.=C2=A0 I have been happily u=
sing that object unchanged for years.</div><div class=3D"gmail_default" sty=
le=3D"font-family:arial,helvetica,sans-serif"><br></div><div class=3D"gmail=
_default" style=3D"font-family:arial,helvetica,sans-serif">Now my new range=
 class is causing me to have to add move semantics not only to that tiny le=
af class but also the 3 new classes layered above it.=C2=A0 As best as I ca=
n tell this is triggered by the fact that throughout the evolution of range=
-base for the expansion has always included initialization the hidden range=
 variable via assignment.=C2=A0 If the range-expression is an invocation of=
 a constructor then is there any reason that the language could not mandate=
 emplace construction?</div><div class=3D"gmail_default" style=3D"font-fami=
ly:arial,helvetica,sans-serif"><br></div><div class=3D"gmail_default" style=
=3D"font-family:arial,helvetica,sans-serif">/john</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/CAJnXXogM%3DQ_OUA2806gwbNtPiQ9f2G8KD4=
9VOXteKB7UWKxUrw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJnXXogM%3DQ_O=
UA2806gwbNtPiQ9f2G8KD49VOXteKB7UWKxUrw%40mail.gmail.com</a>.<br />

--94eb2c0cf7b41eac6205665a37eb--

.
