220 36364 <9d1e799d-b127-457f-9bd2-c815bd914d15@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 13:33:10 -0800 (PST)
Lines: 136
Approved: news@gmane.org
Message-ID: <9d1e799d-b127-457f-9bd2-c815bd914d15@isocpp.org>
References: <ceb89ead-99c9-41fc-a40e-876eac97a6f1@isocpp.org>
 <CAFk2RUab3JK=U0vrxZ6d0r3vaY=-64usQyPHCOf9=V1v-T=XTA@mail.gmail.com>
 <4110e47f-a021-4ccc-9e03-53e4ebdb8c21@isocpp.org> <4605434.q3o9RnjlYE@tjmaciei-mobl1>
 <5300cf40-f7db-4eb6-ad36-4742855124ae@isocpp.org> <CAFk2RUaPfYJCxWTB54eFNBw559Av6XKaLUciixB77by3uLb6eQ@mail.gmail.com>
 <fcf44c66-1097-4242-a265-1629aaf24ebb@isocpp.org>
 <CAFk2RUY3XQiLzsSTiZ6QECf7EK=yEoq+3JGA05783AgbqHVMOg@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_19781_629448826.1514323990603"
X-Trace: blaine.gmane.org 1514323877 30535 195.159.176.226 (26 Dec 2017 21:31:17 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 26 Dec 2017 21:31:17 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDH2LIF7UEOBBGEARPJAKGQELN6VMQA@isocpp.org Tue Dec 26 22:31:13 2017
Return-path: <std-proposals+bncBDH2LIF7UEOBBGEARPJAKGQELN6VMQA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-vk0-f71.google.com ([209.85.213.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDH2LIF7UEOBBGEARPJAKGQELN6VMQA@isocpp.org>)
	id 1eTwoZ-0007WP-5g
	for gclcip-std-proposals@m.gmane.org; Tue, 26 Dec 2017 22:31:11 +0100
Original-Received: by mail-vk0-f71.google.com with SMTP id a67sf12448116vki.21
        for <gclcip-std-proposals@m.gmane.org>; Tue, 26 Dec 2017 13:33:14 -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=hnrpdW2Em4f0qYdqPetbZBP+77U6NrYEVCpdaBuNp8g=;
        b=HN1iR8izvDowhhTJArtaJQ2iU10mEPRE1wxwMVw+zpvwBd/UDjsRbenPv89Ku5DQqM
         AZnrs/F/1Bmq6nm3pQBp2KBp0N6/QJEQOJdUiLOX33PKiiLlY9QvpTeJCN4bbfPMpaZ7
         MobrnA//EPB2h2rs21rDzAjH6g2BHzgC8I/T6F3ot9QPMHXv6qWIpmGs0/crLly4cDS1
         JrHJpBLx81Czwb4bcmbNu3Lum9Uyg6lc9Kl4m+Mon37269jlHCM5sJr7IGe3bLqRNoNZ
         kM/FYJhvVHuzWDEVcilmq9p1EKiS6xE9g0mYMt+mVefUHsMyc+o1qG/gdpMQSh5CQGKo
         othA==
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=hnrpdW2Em4f0qYdqPetbZBP+77U6NrYEVCpdaBuNp8g=;
        b=VBt0Ggjdq780kXj7pibSMiGtwbB/+wJ753/ETB5+o0f8DbYpAa6XwrY1yxNIbukRlu
         Js7dAVTZDmvVoRV8DNBKNK1F/9Fcj8OpoPctXBwKHrzGRIT8UgYxWWO2zx3SKs4wkh3A
         Ba2W+I2cXjPyWvEMEGf/Gbtt8r3Vo/k8o6FALBwj1F/2QJ1GbP6lE4VbZQrIywwUqEij
         W2Tk1kEN6aWpRbIJBepyrhHpSUdcfynZEPtugpyoQNDd7d99NydUAxLljnXH3C+jr8JM
         ykiFiYeh+GdBfdWAVMZRocwUItwzyJTcrNjKsO/rJmdJ/DkDJOTMPSqb37pZCWM8bFH4
         94ug==
X-Gm-Message-State: AKGB3mJYLMt2ThPo2f9cHeXIo4s9D57yqzAEiF3KBxXkuTvRCQ4d/Kgm
	EPWYGfnGvrU+n0OGib8VOtMrgg==
X-Google-Smtp-Source: ACJfBou+7fYmjnOpmsH0vTGV2ZtbSYg4TtdXqNDdUE/Q0x1VmbU2WkUOoRLOttvthHbu0tfI8gkK8w==
X-Received: by 10.176.89.108 with SMTP id o41mr4532037uad.47.1514323993533;
        Tue, 26 Dec 2017 13:33:13 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.150.196 with SMTP id y187ls3468435vkd.10.gmail; Tue, 26 Dec
 2017 13:33:11 -0800 (PST)
X-Received: by 10.31.96.72 with SMTP id u69mr2454317vkb.11.1514323991023;
        Tue, 26 Dec 2017 13:33:11 -0800 (PST)
In-Reply-To: <CAFk2RUY3XQiLzsSTiZ6QECf7EK=yEoq+3JGA05783AgbqHVMOg@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:36364
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36364>

------=_Part_19781_629448826.1514323990603
Content-Type: multipart/alternative; 
	boundary="----=_Part_19782_119203547.1514323990603"

------=_Part_19782_119203547.1514323990603
Content-Type: text/plain; charset="UTF-8"

Could we possibly consider it a defect to be fixed? There never was a good 
reason other than history for them not being guaranteed trivially 
conditional when templated on trivially copyable types. In the same manner 
as how the definition of "trivially copyable" has been retroactively 
changed for the C++11 standard post-C++14 (e.g. that the destructor must 
not be deleted) to clear up the difference in behavior of 
std::is_trivially_copyable between MSVC and lib(std)?c++, couldn't we 
consider it a fix to clear up this ambiguity? After all, even now we have 
slight differences (MSVC has std::pair<int, int> as trivially copyable).

Along with the changes to std::optional and std::variant, we can also make 
this a trend in pushing for types to be more trivial/trivially copyable 
wherever possible.

On Tuesday, December 26, 2017 at 12:11:21 PM UTC-8, Ville Voutilainen wrote:
>
> On 26 December 2017 at 21:51, mrpi via ISO C++ Standard - Future 
> Proposals <std-pr...@isocpp.org <javascript:>> wrote: 
> > Doesn't the same argument about optionals and variants apply? Just 
> recently 
> > std::optional and std::variant weren't yet made trivially copyable (nor 
> have 
> > any recent draft of the standard accepted it yet). What I'm asking about 
> is 
> > doing the same for std::pair and std::tuple. 
>
> The difference is that optional and variant were introduced in C++17, 
> and are still considered 
> experimental by (some) implementations. Both tuple and pair have been 
> there since C++11 or before. 
>
> > And furthermore, what sort of problems would pop up from enforcing 
> > std::tuple<int> to be trivially copyable? 
>
>
> No other problems besides the ABI break, I think. Implementation-wise 
> there's nothing The Elf or his 
> Mighty Maintainer could not do, and the same applies to other 
> implementations and their authors; 
> making such types conditionally trivial is not particularly hard. The 
> warts arise because the C++11 
> types weren't specified or necessarily known how to write in 
> fully-constexpr (constexpr was enhanced 
> in C++14) or fully-triviality-reflecting fashion, and changing that, 
> while doable in a pure C++17 environment, 
> is not always so straightforward when C++11 (and ABI) compatibility is 
> a concern. 
>

-- 
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/9d1e799d-b127-457f-9bd2-c815bd914d15%40isocpp.org.

------=_Part_19782_119203547.1514323990603
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Could we possibly consider it a defect to be fixed? There =
never was a good reason other than history for them not being guaranteed tr=
ivially conditional when templated on trivially copyable types. In the same=
 manner as how the definition of &quot;trivially copyable&quot; has been re=
troactively changed for the C++11 standard post-C++14 (e.g. that the destru=
ctor must not be deleted) to clear up the difference in behavior of std::is=
_trivially_copyable between MSVC and lib(std)?c++, couldn&#39;t we consider=
 it a fix to clear up this ambiguity? After all, even now we have slight di=
fferences (MSVC has std::pair&lt;int, int&gt; as trivially copyable).<div><=
br></div><div>Along with the changes to std::optional and std::variant, we =
can also make this a trend in pushing for types to be more trivial/triviall=
y copyable wherever possible.<br><br>On Tuesday, December 26, 2017 at 12:11=
:21 PM UTC-8, Ville Voutilainen wrote:<blockquote class=3D"gmail_quote" sty=
le=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left=
: 1ex;">On 26 December 2017 at 21:51, mrpi via ISO C++ Standard - Future
<br>Proposals &lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-=
mailto=3D"5JKzHtqpCAAJ" 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; Doesn&#39;t the same argument about optionals and variants apply? =
Just recently
<br>&gt; std::optional and std::variant weren&#39;t yet made trivially copy=
able (nor have
<br>&gt; any recent draft of the standard accepted it yet). What I&#39;m as=
king about is
<br>&gt; doing the same for std::pair and std::tuple.
<br>
<br>The difference is that optional and variant were introduced in C++17,
<br>and are still considered
<br>experimental by (some) implementations. Both tuple and pair have been
<br>there since C++11 or before.
<br>
<br>&gt; And furthermore, what sort of problems would pop up from enforcing
<br>&gt; std::tuple&lt;int&gt; to be trivially copyable?
<br>
<br>
<br>No other problems besides the ABI break, I think. Implementation-wise
<br>there&#39;s nothing The Elf or his
<br>Mighty Maintainer could not do, and the same applies to other
<br>implementations and their authors;
<br>making such types conditionally trivial is not particularly hard. The
<br>warts arise because the C++11
<br>types weren&#39;t specified or necessarily known how to write in
<br>fully-constexpr (constexpr was enhanced
<br>in C++14) or fully-triviality-reflecting fashion, and changing that,
<br>while doable in a pure C++17 environment,
<br>is not always so straightforward when C++11 (and ABI) compatibility is
<br>a concern.
<br></blockquote></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/9d1e799d-b127-457f-9bd2-c815bd914d15%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9d1e799d-b127-457f-9bd2-c815bd914d15=
%40isocpp.org</a>.<br />

------=_Part_19782_119203547.1514323990603--

------=_Part_19781_629448826.1514323990603--

.
