220 36356 <4110e47f-a021-4ccc-9e03-53e4ebdb8c21@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "mrpi via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Default assignment operators for std::pair and std::tuple
Date: Tue, 26 Dec 2017 07:02:05 -0800 (PST)
Lines: 109
Approved: news@gmane.org
Message-ID: <4110e47f-a021-4ccc-9e03-53e4ebdb8c21@isocpp.org>
References: <ceb89ead-99c9-41fc-a40e-876eac97a6f1@isocpp.org>
 <CAFk2RUab3JK=U0vrxZ6d0r3vaY=-64usQyPHCOf9=V1v-T=XTA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_18603_155550226.1514300525168"
X-Trace: blaine.gmane.org 1514300412 5494 195.159.176.226 (26 Dec 2017 15:00:12 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 26 Dec 2017 15:00:12 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDH2LIF7UEOBB3WIRHJAKGQEANPK5WA@isocpp.org Tue Dec 26 16:00:08 2017
Return-path: <std-proposals+bncBDH2LIF7UEOBB3WIRHJAKGQEANPK5WA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f69.google.com ([209.85.213.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDH2LIF7UEOBB3WIRHJAKGQEANPK5WA@isocpp.org>)
	id 1eTqi4-0000vN-VP
	for gclcip-std-proposals@m.gmane.org; Tue, 26 Dec 2017 16:00:05 +0100
Original-Received: by mail-vk0-f69.google.com with SMTP id q198sf11642627vkh.18
        for <gclcip-std-proposals@m.gmane.org>; Tue, 26 Dec 2017 07:02:08 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=fmLCR1reHI89ivoyZ1VStw1cbSA9F3GMXWl7KzoLGSE=;
        b=o4Ur0wuVxE28BwNDJkDgYYLnDmztBS+HDqINjnqHSUiBGmef31Ari6Y5jzAXMgAWwJ
         /pTx399VT5tIYEEP0yyuSyC2B8VW3lmXKgCkQMhcXaCCyr1Z7w4rPPtlNmft+glhAgNv
         3vR+sSzqwn9Ze4WPFBGvyOMBNokVVbBgn4VGCTmwYOD6cJkqqlHQZLsA826S1B8CNOee
         qEpMjCo8vwSEvB17Nn13OyZ6XUgGdGtjb0CdnxO1LnOyhLPAfAejZeXnZDZYzWbpHc3v
         O5qes4LuCaks74hWBBBlJGgjFu3tHK4SCUX77OKcOOZsGgdvuqlbj2nfTcVPD6p8pm4g
         jeZw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to: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=fmLCR1reHI89ivoyZ1VStw1cbSA9F3GMXWl7KzoLGSE=;
        b=ufz43/7dUkNK+Z7fs+eOLHoopA9rqBT/3fPcZaev1dJXcrcxXMS6GMB6K6ZaWI0wNh
         hArxSmoCN0SkW9TAZZXjCuYtLBkUItURsfMSp5dq2nCI/6dgHKUI1YdUwPL7KcT+wWuT
         dnRLagAFJN6mEf3ZUZgYUJEpttDAS7LM7oEsUt5I4Z9p62hyVL+p8LKalFdFXjeF8A6A
         lqYZYPk5te1cLDm2RQ/XGOhAa1TAb8HTovCumw3Z7aVE1RVvNSEd4c8qGLQ3bcHsWR4R
         RzLnU1wYSQGGe1EjQkpt6gzErwOpO5yJPUMNa22XU6bZtif8lnMCAsE1aj02V/CMViB2
         HRFg==
X-Gm-Message-State: AKGB3mKmdZl0hhipK8xOfESte9jMpKab9F69aEbg4C+LuDE3/JmzrM4+
	U/dSuS7G3FPXzqhSYCa7STYXUA==
X-Google-Smtp-Source: ACJfBouJRS5OtUNBlW4V6/UxPtJO8/lKA40HycrSF2xR9P9Pe0UoQugGhOrdhEEKU9JFeCTxyU8zUQ==
X-Received: by 10.31.2.208 with SMTP id 199mr11940279vkc.3.1514300527424;
        Tue, 26 Dec 2017 07:02:07 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.176.69.226 with SMTP id u89ls1860871uau.0.gmail; Tue, 26 Dec
 2017 07:02:06 -0800 (PST)
X-Received: by 10.31.171.73 with SMTP id u70mr2384974vke.10.1514300525636;
        Tue, 26 Dec 2017 07:02:05 -0800 (PST)
In-Reply-To: <CAFk2RUab3JK=U0vrxZ6d0r3vaY=-64usQyPHCOf9=V1v-T=XTA@mail.gmail.com>
X-Original-Sender: mrpi@google.com
X-Original-From: mrpi@google.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:36356
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36356>

------=_Part_18603_155550226.1514300525168
Content-Type: multipart/alternative; 
	boundary="----=_Part_18604_1016768534.1514300525168"

------=_Part_18604_1016768534.1514300525168
Content-Type: text/plain; charset="UTF-8"

Sorry, I might not be understanding it correctly, but in what way would it 
be an ABI break, given that reference types are not trivially copyable 
anyways?

On Tuesday, December 26, 2017 at 5:50:57 AM UTC-8, Ville Voutilainen wrote:
>
> On 26 December 2017 at 15:46, mrpi via ISO C++ Standard - Future 
> Proposals <std-pr...@isocpp.org <javascript:>> wrote: 
> > Given that the copy and move constructors of both std::pair and 
> std::tuple 
> > are defaulted, why shouldn't we enforce the same for their respective 
> > assignment operators? It seems strange that assigning these types would 
> > invoke non-trivial work compared to just copy constructing them, and as 
> a 
> > result of this difference, currently both types are not considered 
> trivially 
> > copyable. 
> > 
> > Based on an old discussion, it seems that this discrepancy in the 
> > requirement caused some compilers to make std::pair<scalar> trivially 
> > copyable while others don't. Furthermore, someone on StackOverflow 
> hacked up 
> > an implementation for std::tuple that was trivially copyable. It would 
> be 
> > nice if future proposals can provide some potential guarantees on this 
> > matter. 
>
> The assignment operators need to be user-provided for reference 
> elements. Both pair and tuple can be made 
> conditionally trivial when there are no reference elements, but doing 
> so is an ABI break. 
>

-- 
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/4110e47f-a021-4ccc-9e03-53e4ebdb8c21%40isocpp.org.

------=_Part_18604_1016768534.1514300525168
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Sorry, I might not be understanding it correctly, but in w=
hat way would it be an ABI break, given that reference types are not trivia=
lly copyable anyways?<br><br>On Tuesday, December 26, 2017 at 5:50:57 AM UT=
C-8, Ville Voutilainen wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">O=
n 26 December 2017 at 15:46, mrpi via ISO C++ Standard - Future
<br>Proposals &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-=
mailto=3D"USJn2ReVCAAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;ja=
vascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;r=
eturn true;">std-pr...@isocpp.org</a>&gt; wrote:
<br>&gt; Given that the copy and move constructors of both std::pair and st=
d::tuple
<br>&gt; are defaulted, why shouldn&#39;t we enforce the same for their res=
pective
<br>&gt; assignment operators? It seems strange that assigning these types =
would
<br>&gt; invoke non-trivial work compared to just copy constructing them, a=
nd as a
<br>&gt; result of this difference, currently both types are not considered=
 trivially
<br>&gt; copyable.
<br>&gt;
<br>&gt; Based on an old discussion, it seems that this discrepancy in the
<br>&gt; requirement caused some compilers to make std::pair&lt;scalar&gt; =
trivially
<br>&gt; copyable while others don&#39;t. Furthermore, someone on StackOver=
flow hacked up
<br>&gt; an implementation for std::tuple that was trivially copyable. It w=
ould be
<br>&gt; nice if future proposals can provide some potential guarantees on =
this
<br>&gt; matter.
<br>
<br>The assignment operators need to be user-provided for reference
<br>elements. Both pair and tuple can be made
<br>conditionally trivial when there are no reference elements, but doing
<br>so is an ABI break.
<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/4110e47f-a021-4ccc-9e03-53e4ebdb8c21%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4110e47f-a021-4ccc-9e03-53e4ebdb8c21=
%40isocpp.org</a>.<br />

------=_Part_18604_1016768534.1514300525168--

------=_Part_18603_155550226.1514300525168--

.
