From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 56C7A3830B63 for ; Thu, 27 Jun 2024 20:30:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56C7A3830B63 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 56C7A3830B63 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719520244; cv=none; b=ZW3hPnlhD7XyeXt7h5ZgBfB5uUsKd1H+SGDqXL+Cjux5AS+rSj9b/l2k8eq76Hk1GX5rh4XwoitFL8yyacpcXqr0XCY6T5EvaHyfDBk6ZJuheYlk9kOuzWmZtUwnIEalJTsdFm40mXHAbFJcYMlYtIh70y9n3+kVTDrrcYUIK9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719520244; c=relaxed/simple; bh=/2f43ZbDf6tvcAc9QziGx0iPw/xCDcCb5Js/AoG4b2E=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=pC7zsdqY66OiDMdLo+/meh/ZyGTb/gtFKbmq3dQPbpmcEArypaUb/HdAdgfHqjbu5ObgR2g9HuiF1BZy+Da2efoHM2f9NIeWpBf4sj8X8KZPKJrguNoZWXEVLKqbNB69GW0+hatQ79WUvJR6cQkNYhuNOx6TU2ZF2GJIZPg75Co= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719520243; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/2f43ZbDf6tvcAc9QziGx0iPw/xCDcCb5Js/AoG4b2E=; b=inM5cmQyQksn2HGhdAvNec98jJPXPoadj8eJM8ixswTCF0S0ZByVMc50T9LUdCA9MSqLQC sQS+b5jsgCqR2VhRsWblpMz/InUyD/hAhpDwQQrPOcv2jXV4g6PS9r75EaqV7uyD+3Az95 exW+uice3Ng2shLXfbk0qonsf7xa55g= Received: from mail-yw1-f199.google.com (mail-yw1-f199.google.com [209.85.128.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-680-AARWq5PuOeCFk2Stt8bIIA-1; Thu, 27 Jun 2024 16:30:38 -0400 X-MC-Unique: AARWq5PuOeCFk2Stt8bIIA-1 Received: by mail-yw1-f199.google.com with SMTP id 00721157ae682-64a5503e253so9471597b3.0 for ; Thu, 27 Jun 2024 13:30:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719520238; x=1720125038; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/2f43ZbDf6tvcAc9QziGx0iPw/xCDcCb5Js/AoG4b2E=; b=Ft0+/ctBhQifSLj+bHT6kJ5U8aIe213J7D3KIFNOFrndTkYLLePHplet1b3bFWb9JP pV5BQHCNDGrfT8g2OQzqXzXHyLdCZuQz+19+lezSWAi0b8IQZeBv3lp4RiSqNSMVZNEC zJfNX7cu6aSxPFSFMDTGVtaYodaT+EBxhM1ZFRiKDOjNbyd0Rijg1Q/GpMLgUg6NpK69 jLDhFBrXqiFVkUMOBDiX+zm0zHHbrSyRTbZCHkVbMVxKENT9SkB6PQE6+zMHI/M+GEiJ mDs71XklmHAzxRh+yB3TFzX5hB2t6KigJ1VnjWVZqw3I7iewUhDqr3xhJwQPTrfSuTxy dclQ== X-Gm-Message-State: AOJu0YzNlPMYW8YyiYnHod2sFt3ClsofcixGUPJ7rdZe/HhwkGhhstS0 jbdJWC74WllDGBvbRt+LjAK1uQ+EbnHV7TZfTUu2/tYnMC6M74Govb+YypQpehP/4skrThZsJmX DCVr1OOXzbExHHkGjy8JdN3Vx0xzy2t9vrYyCBYBkbp7tsHG0AsrRUB7ni1NLJYc2yaikVaMB1I GcHr8t2ixu28kWrwqW6xmRbr5GxM0= X-Received: by 2002:a81:a551:0:b0:62c:fc0a:bf15 with SMTP id 00721157ae682-643a990bf87mr148120017b3.3.1719520238182; Thu, 27 Jun 2024 13:30:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHVtZrRsKRznId1DdSVpudwuBwo95gAg6sfeCtGcKMxTdRtbDvM7LWMNw85sWHeFrytg7S5D2ad2lHXLtFIIE8= X-Received: by 2002:a81:a551:0:b0:62c:fc0a:bf15 with SMTP id 00721157ae682-643a990bf87mr148119747b3.3.1719520237804; Thu, 27 Jun 2024 13:30:37 -0700 (PDT) MIME-Version: 1.0 References: <8ed737bd-4b8e-4233-833b-c44d10b37aca@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Thu, 27 Jun 2024 21:30:21 +0100 Message-ID: Subject: Re: [PATCH] _Hashtable fancy pointer support To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 27 Jun 2024 at 20:25, Fran=C3=A7ois Dumont w= rote: > > Thanks for the link, based on it I removed some of the nullptr usages > keeping only assignments. That's not necessary. A nullable pointer type is equality comparable with nullptr_t, and nullptr can be implicitly converted to the pointer type. Your _S_case function is wrong though: you can't construct the fancy pointer type from a raw pointer. You need to use pointer_traits<__node_ptr>::pointer_to(*rawptr). > > Fran=C3=A7ois > > On 26/06/2024 23:41, Jonathan Wakely wrote: > > On Wed, 26 Jun 2024 at 21:39, Fran=C3=A7ois Dumont wrote: > >> Hi > >> > >> Here is my proposal to add support for fancy allocator pointer. > >> > >> The only place where we still have C pointers is at the > >> iterator::pointer level but it's consistent with std::list > >> implementation and also logical considering that we do not get > >> value_type pointers from the allocator. > >> > >> I also wondered if it was ok to use nullptr in different places or if = I > >> should rather do __node_ptr{}. But recent modifications are using > >> nullptr so I think it's fine. > > I haven't reviewed the patch yet, but this answers the nullptr question= : > > https://en.cppreference.com/w/cpp/named_req/NullablePointer > > (aka Cpp17NullablePointer in the C++ standard). > >