220 4858 <CALX6VwpUZ6mwmse0Q8MR4ND1eOQTOMkN_K1LC597M6K15=Gspw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Alex B <devalexb@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: Proposal: std::sequence
Date: Tue, 4 Jun 2013 15:56:24 -0400
Lines: 169
Approved: news@gmane.org
Message-ID: <CALX6VwpUZ6mwmse0Q8MR4ND1eOQTOMkN_K1LC597M6K15=Gspw@mail.gmail.com>
References: <4551abbc-43aa-4520-a91a-f8eb25a90588@isocpp.org>
	<e915df62-4930-48ee-a8ac-64261c407234@isocpp.org>
	<2c8e6079-9c87-425a-93e2-39251df57cd8@isocpp.org>
	<CANh-dX=va9uLSbvQc_TRmf8o5TDzQutmkxJDc64g7b=yKyN7sg@mail.gmail.com>
	<9f1cace3-0503-4a3c-a8ce-d7546564b3ef@isocpp.org>
	<a6f024b6-45d6-4c3b-b8a6-3f056aeab51f@isocpp.org>
	<c029551c-241c-4809-adaa-7908434ba10d@isocpp.org>
	<ed3c548d-b470-47ec-850e-95d3c11e29a8@isocpp.org>
	<1c991e6e-6bc3-4822-9ffd-7f2508e63974@isocpp.org>
	<d9ba9a97-bbd0-477a-b7ac-9db84da40458@isocpp.org>
	<CANh-dXkzTTq1pe9SdQ4xi2g6q=mjeWyzKAY3dJ82iRPzFaC6vw@mail.gmail.com>
	<CAGg_6+O=cC8kRgR=s1dG0p5vcqX4q_-KdtuFmOeK+Vh=Bub1mQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=089e0158c302d6dc2904de597968
X-Trace: ger.gmane.org 1370375787 24733 80.91.229.3 (4 Jun 2013 19:56:27 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 4 Jun 2013 19:56:27 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBC7JZJ43WYOBB2UMXGGQKGQEG37UD4Y@isocpp.org Tue Jun 04 21:56:27 2013
Return-path: <std-proposals+bncBC7JZJ43WYOBB2UMXGGQKGQEG37UD4Y@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wg0-f69.google.com ([74.125.82.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBC7JZJ43WYOBB2UMXGGQKGQEG37UD4Y@isocpp.org>)
	id 1UjxLH-0006Vk-3q
	for gclcip-std-proposals@m.gmane.org; Tue, 04 Jun 2013 21:56:27 +0200
Original-Received: by mail-wg0-f69.google.com with SMTP id j13sf625319wgh.8
        for <gclcip-std-proposals@m.gmane.org>; Tue, 04 Jun 2013 12:56:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:sender:in-reply-to:references:date
         :message-id:subject:from:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-google-group-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=3dOtTDZL9+hmbRbwSlnVvU0/yXN1Ht6ZWLSN3xkHNQM=;
        b=mP5D+msCujapL8PUEY4iLXuITtSEOwASkoEF8dj0NJHb9vUry9jiLN/JPQXftW0Gcz
         FU/K7El/v5UMz5o5VBKgPecLeHNAdsoOJJOMdF6OzRnRa4lpe5ZFkm51RHMY8HpKffim
         M09nplwh/vhCQl3Q1IRkvVxcAcBfa7q3jyJPdskB5P9UgQRP/HUYRRZKUoKACuCHO6Yu
         b6iEc+0AwLBc2rIySm84AuF8yv17ICUFD1e5dTzGxcuPJwjwuUxvhkS6y1IhtMojVIFI
         Yz1jWgm35c3HRhh8h5z6OPZK7ZD/MxLAHF+y70+YRqJkzaDkfES6zHSS1H0MLfqlSRpE
         mWDw==
X-Received: by 10.152.22.226 with SMTP id h2mr6877658laf.2.1370375786355;
        Tue, 04 Jun 2013 12:56:26 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.26.225 with SMTP id o1ls29568lag.66.gmail; Tue, 04 Jun
 2013 12:56:24 -0700 (PDT)
X-Received: by 10.112.18.196 with SMTP id y4mr13376813lbd.60.1370375784791;
        Tue, 04 Jun 2013 12:56:24 -0700 (PDT)
Original-Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com [209.85.217.173])
        by mx.google.com with ESMTPS id la8si18650736lab.148.2013.06.04.12.56.24
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Tue, 04 Jun 2013 12:56:24 -0700 (PDT)
Received-SPF: pass (google.com: domain of boivina@gmail.com designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173;
Original-Received: by mail-lb0-f173.google.com with SMTP id t10so1102176lbi.4
        for <std-proposals@isocpp.org>; Tue, 04 Jun 2013 12:56:24 -0700 (PDT)
X-Received: by 10.152.22.199 with SMTP id g7mr13096330laf.20.1370375784420;
 Tue, 04 Jun 2013 12:56:24 -0700 (PDT)
Original-Sender: boivina@gmail.com
Original-Received: by 10.114.172.232 with HTTP; Tue, 4 Jun 2013 12:56:24 -0700 (PDT)
In-Reply-To: <CAGg_6+O=cC8kRgR=s1dG0p5vcqX4q_-KdtuFmOeK+Vh=Bub1mQ@mail.gmail.com>
X-Original-Sender: devalexb@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of boivina@gmail.com designates 209.85.217.173 as permitted sender)
 smtp.mail=boivina@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post?hl=en>,
 <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?hl=en&topic=25838>,
 <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe?hl=en>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:4858
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/4858>

--089e0158c302d6dc2904de597968
Content-Type: text/plain; charset=ISO-8859-1

Or you could just use std::copy to copy elements from one dynarray to
another. That sounds like a clean way to do it for dynarrays and isn't a
hack.

Making dynarray assignable would only allow even more "clean hacks" like
the one you mentionned. For example, it would indirectly allow the dynarray
to be resized (which goes against the idea of dynarray):

template <class T>
void ResizeDynArray(dynarray<T>& d, size_t s)
{
   dynarray<T> temp{s};
   copy_n(d.begin(), min(d.size(), s), temp.begin());
   d = temp;
}


On Tue, Jun 4, 2013 at 3:03 PM, Nevin Liber <nevin@eviloverlord.com> wrote:

> On 4 June 2013 13:54, Jeffrey Yasskin <jyasskin@google.com> wrote:
>
>>
>> Please don't say "clearly" here. Assignability is the default in C++,
>> and it's quite possible that our implementations stumbled into it
>> without actually having a firm use case. It would take actual research
>> to determine that we have a real need. (I suspect we do, but my
>> suspicion doesn't prove anything, and I'm not currently planning to
>> investigate in detail.)
>>
>
> Other than dynarray, is there any class in the standard that is copyable
> but not assignable?
>
> And I'm a bit worried about dynarray, as I suspect more than a few people
> are going to try mostly working "destruct then placement new" abomination
> to get around it.  Of course, I didn't think of that in Bristol, and a
> clean hack circumventing the issue is optional<dynarray<T>>, but I
> digress...
> --
>  Nevin ":-)" Liber  <mailto:nevin@eviloverlord.com>  (847) 691-1404
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/a/isocpp.org/d/topic/std-proposals/ECVE9Dq1vn0/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
> std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.
>
>
>

-- 

--- 
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.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/?hl=en.



--089e0158c302d6dc2904de597968
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div style>Or you could just use std::copy to copy element=
s from one dynarray to another. That sounds like a clean way to do it for d=
ynarrays and isn&#39;t a hack.</div><div><br></div>Making dynarray assignab=
le would only allow even more &quot;clean hacks&quot; like the one you ment=
ionned. For example, it would indirectly allow the dynarray to be resized (=
which goes against the idea of dynarray):<div>
<br></div><div style><font face=3D"courier new, monospace">template &lt;cla=
ss T&gt;</font></div><div style><font face=3D"courier new, monospace">void =
ResizeDynArray(dynarray&lt;T&gt;&amp; d, size_t s)</font></div><div style><=
font face=3D"courier new, monospace">{</font></div>
<div style><font face=3D"courier new, monospace">=A0 =A0dynarray&lt;T&gt; t=
emp{s};</font></div><div style><font face=3D"courier new, monospace">=A0 =
=A0copy_n(<font color=3D"#000000"><span style=3D"line-height:15.59375px">d.=
begin(), min(d.size(), s), temp.begin());</span></font></font></div>
<div style><font color=3D"#000000" face=3D"courier new, monospace"><span st=
yle=3D"line-height:15.59375px">=A0 =A0d =3D temp;</span></font></div><div s=
tyle><font face=3D"courier new, monospace">}</font></div></div><div class=
=3D"gmail_extra">
<br><br><div class=3D"gmail_quote">On Tue, Jun 4, 2013 at 3:03 PM, Nevin Li=
ber <span dir=3D"ltr">&lt;<a href=3D"mailto:nevin@eviloverlord.com" target=
=3D"_blank">nevin@eviloverlord.com</a>&gt;</span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">
<div class=3D"im">On 4 June 2013 13:54, Jeffrey Yasskin <span dir=3D"ltr">&=
lt;<a href=3D"mailto:jyasskin@google.com" target=3D"_blank">jyasskin@google=
..com</a>&gt;</span> wrote:<br></div><div class=3D"gmail_quote"><div class=
=3D"im"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex">


<div><br>
</div>Please don&#39;t say &quot;clearly&quot; here. Assignability is the d=
efault in C++,<br>
and it&#39;s quite possible that our implementations stumbled into it<br>
without actually having a firm use case. It would take actual research<br>
to determine that we have a real need. (I suspect we do, but my<br>
suspicion doesn&#39;t prove anything, and I&#39;m not currently planning to=
<br>
investigate in detail.)<br></blockquote></div><div><br>Other than dynarray,=
 is there any class in the standard that is copyable but not assignable?<br=
><br>And I&#39;m a bit worried about dynarray, as I suspect more than a few=
 people are going to try mostly working &quot;destruct then placement new&q=
uot; abomination to get around it.=A0 Of course, I didn&#39;t think of that=
 in Bristol, and a clean hack circumventing the issue is optional&lt;dynarr=
ay&lt;T&gt;&gt;, but I digress...<br>


</div></div><div class=3D"im">-- <br>=A0Nevin &quot;:-)&quot; Liber=A0 &lt;=
mailto:<a href=3D"mailto:nevin@eviloverlord.com" target=3D"_blank">nevin@ev=
iloverlord.com</a>&gt;=A0 <a href=3D"tel:%28847%29%20691-1404" value=3D"+18=
476911404" target=3D"_blank">(847) 691-1404</a>

<p></p></div>

-- <br><div class=3D"HOEnZb"><div class=3D"h5">
=A0<br>
--- <br>
You received this message because you are subscribed to a topic in the Goog=
le Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this topic, visit <a href=3D"https://groups.google.com/=
a/isocpp.org/d/topic/std-proposals/ECVE9Dq1vn0/unsubscribe?hl=3Den" target=
=3D"_blank">https://groups.google.com/a/isocpp.org/d/topic/std-proposals/EC=
VE9Dq1vn0/unsubscribe?hl=3Den</a>.<br>

To unsubscribe from this group and all its topics, send an email to <a href=
=3D"mailto:std-proposals%2Bunsubscribe@isocpp.org" target=3D"_blank">std-pr=
oposals+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>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den" target=3D"_blank">http://groups.google.com/a/isocpp=
..org/group/std-proposals/?hl=3Den</a>.<br>
=A0<br>
=A0<br>
</div></div></blockquote></div><br></div>

<p></p>

-- <br />
&nbsp;<br />
--- <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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/?hl=3Den">http://groups.google.com/a/isocpp.org/group/std-pro=
posals/?hl=3Den</a>.<br />
&nbsp;<br />
&nbsp;<br />

--089e0158c302d6dc2904de597968--

.
