From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by sourceware.org (Postfix) with ESMTPS id 18E3C3857836 for ; Wed, 7 Apr 2021 18:27:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18E3C3857836 Received: by mail-qk1-x72f.google.com with SMTP id o5so19846461qkb.0 for ; Wed, 07 Apr 2021 11:27:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cxQnc2HZ4en83garETGL3MoMNGd4fwcgfcsQnBxcc2I=; b=jDQX+27D1Q5NB8i8TDRI1HSXSsxp68yrWcVrL/wQCRjkUf+3dyieydmmidErijHTPg a5tWeK2sb4TvvJtFmjIESWLqoQzIOSbwVQEH69fFUggPkKynVO61jhrsm6OerhsdQGW+ 7xHakhKItq2EfK+OMcaJPlTaEVBPGmBo/nFZjIrmZjl1MqDp+es5deqhSsuaCfIqDTDW +GLALSVqz4uTAMtz457Q8qmtOxe7F8WqzaHutwWifA9nNKY5utXool4OtKVp8i928gu4 PkS5E1KZ5iLf/6pf9vBl6PUqfKVLtC+KYjVE7LiVAGQTD1EyeW5pam2EQPdq/BfMlWkd vvmQ== X-Gm-Message-State: AOAM532EzB75XFynZnHnQmDGD0SKnGFC9pZt622aidsTFmNxseuhbrvE 3aNOxL/Z3cugQXl2kvKhqa/fxldwOBpakizwrC0= X-Google-Smtp-Source: ABdhPJwlz6kKesD6+zbiowVHt/Qec4OcisFVpbY7s55UlARRwi/YHQG9Bov7/F6cRUKoyyr6UmAMMjQLZXt/uWAQOqg= X-Received: by 2002:ae9:e010:: with SMTP id m16mr4454917qkk.44.1617820029741; Wed, 07 Apr 2021 11:27:09 -0700 (PDT) MIME-Version: 1.0 References: <20210407123050.GY3008@redhat.com> <20210407124654.GZ3008@redhat.com> <20210407165922.GA3008@redhat.com> <20210407180030.GC3008@redhat.com> <20210407181713.GD3008@redhat.com> In-Reply-To: From: Ville Voutilainen Date: Wed, 7 Apr 2021 21:26:58 +0300 Message-ID: Subject: Re: [RFC] Deprecate non-standard constructors in std::pair To: Jonathan Wakely Cc: "libstdc++" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2021 18:27:11 -0000 On Wed, 7 Apr 2021 at 21:25, Ville Voutilainen wrote: > > On Wed, 7 Apr 2021 at 21:17, Jonathan Wakely wrote: > > This fails to compile because of that bug: > > > > #include > > > > struct X { > > X(void* = 0) { } > > X(const X&) = default; > > X(const X&&) = delete; > > }; > > > > struct move_only { > > move_only() = default; > > move_only(move_only&&) = default; > > }; > > > > std::pair p0(move_only(), 0); > > std::pair p1(move_only(), {}); > > > > The pair(U1&&, const T2&) constructor should be viable, but it fails > > the _MoveCopyPair constraint check because X(const X&&) is deleted. > > > > I'm not sure I care about this though. It would only work because of > > those non-standard constructors which we're talking about deprecating. > > I'm not very motivated to fix them so they accept this, when we're > > going to deprecate them anyway. > > Nah, let's not bother. The type X has an explicitly deleted move > constructor, which the library > doesn't go to heroic extents to support. And more than that, it's trying to be a "copy-only" type, which the library doesn't try to support at all, quite the contrary.