220 36355 <CAFk2RUab3JK=U0vrxZ6d0r3vaY=-64usQyPHCOf9=V1v-T=XTA@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Ville Voutilainen <ville.voutilainen@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Default assignment operators for std::pair and std::tuple
Date: Tue, 26 Dec 2017 15:50:55 +0200
Lines: 27
Approved: news@gmane.org
Message-ID: <CAFk2RUab3JK=U0vrxZ6d0r3vaY=-64usQyPHCOf9=V1v-T=XTA@mail.gmail.com>
References: <ceb89ead-99c9-41fc-a40e-876eac97a6f1@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1514296139 14716 195.159.176.226 (26 Dec 2017 13:48:59 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 26 Dec 2017 13:48:59 +0000 (UTC)
To: "ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBC5JHI7A7ALRBQFHRHJAKGQE5EBWO6Q@isocpp.org Tue Dec 26 14:48:55 2017
Return-path: <std-proposals+bncBC5JHI7A7ALRBQFHRHJAKGQE5EBWO6Q@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-oi0-f71.google.com ([209.85.218.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBC5JHI7A7ALRBQFHRHJAKGQE5EBWO6Q@isocpp.org>)
	id 1eTpbC-0003PK-No
	for gclcip-std-proposals@m.gmane.org; Tue, 26 Dec 2017 14:48:54 +0100
Original-Received: by mail-oi0-f71.google.com with SMTP id s9sf16234999oie.2
        for <gclcip-std-proposals@m.gmane.org>; Tue, 26 Dec 2017 05:50:57 -0800 (PST)
ARC-Seal: i=2; a=rsa-sha256; t=1514296256; cv=pass;
        d=google.com; s=arc-20160816;
        b=BI1MGtkx/AxXCK8Bk/SBaI9i6tfv8/xmTLJmmffcbkjO22zIsNb84zLSIzDq5fVM/B
         IFsbajEQS90KTAqcv699OKbgsakbO80QkIHN+xAD284PnBlbRiFDTJVwNbrVP5SiAzLL
         o6VDP2fNw7RZonvXk4CXY8KNo0LButwOw3QtUx+HSNCF01LNLC1WtROAUlBM/bGEsag6
         9e8uZxvJ3oYgyO12aVDNITc+dwp//qQRREwggu56pCOnavvY0HiZHlPQaTtGP9AeJoPn
         f8vkwkeEstYKqPCvmMhIaIK5TA9Mviec43T0ohwodgA8vp35yiY2tGQffYcrU3C8wYI8
         FFPA==
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:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=ZOO5rm91GplOejm9LCbLBkHqzOGgiJPS20R9aWJcMoI=;
        b=Vm4cKmyJWpTYwrVnMxQ9/0DC0WWqcr338n+wkc1qJxJ8c0sO3PaYh46Vqs4zg45Zi5
         biicXgyffwF2IXS0L/IC12FeFqgPFYN7e/fo2UH//gFYfD07Y68h1gStrzsjop2dHJIk
         7zrCOmCmSlRD3OQw66o0/ZKDYAl5MmvO3ODtzcMaYLaD6InztXaO/fW08cP4CQoagdSX
         JovkX46Vu9Q2TVqZAWdOYIDlUeQlGqBO8iqXtupZx2FYkJDsjJnyA4J0SJkJpb/1sroq
         xjE7VsSdAA2pYbU01gUFCloNwN8E7aHfFa5FANJiW45HjPXICUd1An+XUG+ay5C+pIhE
         qlSw==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=EtgU0pPU;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE 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:in-reply-to:references:from:date:message-id:subject:to
         :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=ZOO5rm91GplOejm9LCbLBkHqzOGgiJPS20R9aWJcMoI=;
        b=KdAqxDJGIUAj6KNISv4wIzlLAeZCqtEM5dC6u0SojsFAT4K5NOQw2iHQGb9tVmi9WA
         hBHSvTMUdSg14jX3nUW2KNRRP2zOSEsi8f0RAigWbJh3QMyafgd+IhaphY6FAnfwyVkz
         2Tr0G6b/7VQwFAqkzNEOdsRCl+6eLRBseTYggNl2kJdCPBXa5MfF8BbX+xVYQDwbFb1/
         2UfR8wPAP1vUubLhXKHqQF1bOQx2CHfWuCch+nXUlsePf4Bj56MAkWKhhAoxlIJZAPFv
         9zTRcpD3qHuUvIoexfJHlWGA2x27AKpL8c0m++T3BIsDxNW7hpPv0pYzlFgDiS4VejzF
         gN2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references: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=ZOO5rm91GplOejm9LCbLBkHqzOGgiJPS20R9aWJcMoI=;
        b=nZGpVM9fSM+TUEgSyb6guhs9gskVuM4xninfEsj9BEP1cNQht4hAo1hMVpew9V6BLl
         tZHSodV00YCRe+DqwuxfPCPgq9DK7ks5Q96T0J2bbYTGFs8jaqDNJDdy6nyeDr+HAaSW
         zwyuOW63SSrIlUfi7jKPkkcdCzXAv0tUDxmCviy8+xgnEAycGZDgwXCDAMF3SJQxAvOi
         AUgUZz1VXwr9LtTCiZgSIXOKC3Etmk4/Ufj6MuM/NJTVUgV2Tqik1l1u0Kzacpm6pTc+
         gtrI3l/OqzRVKopFOkcPDdL+NfnU5/+UpwQgOlQsyY+45Vw79s4dd7d8j27FL5/ZhBmD
         UiDg==
X-Gm-Message-State: AKGB3mIAlcB2ZRzMQ4Z7trMYiid7yheuwnbuUHa1Wbhvchk0WVFFqvDY
	ilaQqiE0ie7NyT7Jxk/YqkMXIg==
X-Google-Smtp-Source: ACJfBosEWajttnH9F9WAhZFUvuGescApJs1dQneufYDaGWXfYqSbDBszSPWlwM405pDziLOc/N9XcA==
X-Received: by 10.157.90.8 with SMTP id v8mr3648529oth.69.1514296256773;
        Tue, 26 Dec 2017 05:50:56 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.16.91 with SMTP id o27ls1552514oto.17.gmail; Tue, 26 Dec
 2017 05:50:55 -0800 (PST)
X-Received: by 10.157.10.229 with SMTP id 92mr15816110otq.333.1514296255866;
        Tue, 26 Dec 2017 05:50:55 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1514296255; cv=none;
        d=google.com; s=arc-20160816;
        b=mtiDS6pdfq/wK0hix1AVjfwiiO4RxEoCUONbTWxCRguoLi/pWkiCWmeJpEVknthxKF
         aegqdOSCRe/LGW1jUqwas7YQoRR8EuETrdR3ic59dyAf6miCTXOECkA8Truaa7R5mTaT
         GBc38guxA0qFAfAjDcoZcqMnDsURInci2N2FrGGMNGA0RAvCenqXX4d5jlWfrDqBr2Zy
         9g4wFGHpO0aiM54AlTHMaiF71pDmQCSu9w5ml8QKNr1BXCQUJWjvUH8gnCebs0zn5s+V
         N5e/gPsybPMnFIkGnAqorqlxw/EKcOBQsZhXWoq8ftA2Rbn+XtgSPDUyDp81l7aoBpX8
         SODw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=qM4OKAKVEn7jbmGvXIfSd39HB8VO93ovxZzGsCALiZE=;
        b=X9hJ4R4cNqxMQalpGuZM1NjXSF3tbezNDFsvfd0alqrqk7fKJBvCKaT+htnPWHYmJG
         VdWPwoKDHVe+zdIpkvBQRQjE38imge4UUPevsm1f0s+MYKs/nJdMXZtNL5QESKlaXAX2
         qMtokg7aG6bb3pp26fci9xTUMAYiIoQCtpBh0qbzSLqBi4au2XsyTiiJzWNPKmm1yND3
         1B782yUFvxadofK2cO2JMlsfgzXJDrD4oeK/AkeF1F7cnUncma7UH2f35RTWPbXX4t+3
         Cv2nrnXbhVoV5sth3kpgN8sddw3NOsEtgcXgKUS7i495EWjqdRkoluc7mhcolbhauSvF
         Acaw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@gmail.com header.s=20161025 header.b=EtgU0pPU;
       spf=pass (google.com: domain of ville.voutilainen@gmail.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE 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 w53sor1694393otd.193.2017.12.26.05.50.55
        for <std-proposals@isocpp.org>
        (Google Transport Security);
        Tue, 26 Dec 2017 05:50:55 -0800 (PST)
Received-SPF: pass (google.com: domain of ville.voutilainen@gmail.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41;
X-Received: by 10.157.91.37 with SMTP id x34mr20544113oth.176.1514296255427;
 Tue, 26 Dec 2017 05:50:55 -0800 (PST)
Original-Received: by 10.157.43.248 with HTTP; Tue, 26 Dec 2017 05:50:55 -0800 (PST)
In-Reply-To: <ceb89ead-99c9-41fc-a40e-876eac97a6f1@isocpp.org>
X-Original-Sender: ville.voutilainen@gmail.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@gmail.com header.s=20161025 header.b=EtgU0pPU;       spf=pass
 (google.com: domain of ville.voutilainen@gmail.com designates 209.85.220.41
 as permitted sender) smtp.mailfrom=ville.voutilainen@gmail.com;
       dmarc=pass (p=NONE sp=NONE 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:36355
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/36355>

On 26 December 2017 at 15:46, mrpi via ISO C++ Standard - Future
Proposals <std-proposals@isocpp.org> 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/CAFk2RUab3JK%3DU0vrxZ6d0r3vaY%3D-64usQyPHCOf9%3DV1v-T%3DXTA%40mail.gmail.com.

.
