Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSxIw-00A2jn-1M for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 12:58:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSxIt-004dE9-1K for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Dec 2025 12:58:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSxIt-004dE1-0G for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 12:58:55 +0000 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vSxIr-003vmt-1o for pgsql-hackers@lists.postgresql.org; Tue, 09 Dec 2025 12:58:54 +0000 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-37ce27af365so45154781fa.0 for ; Tue, 09 Dec 2025 04:58:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeltef.nl; s=google; t=1765285132; x=1765889932; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Gr+eyGi59A1GxVzaLMCUCbai75PTh6BNoqhkW7rqKHM=; b=ZCj9cyNOhO+2pchoqmUHVDzJcVfW013GwGqnQmuQxp0KFskl/NvGNV+jdO0Y1rvmSy /li3gcLwVZAuG3jNEPwq9v5C/ErLwN87JsiOuPBXphK8Wfc57YuXxNMgs/MXTpzfZJ7t NWu44JhsnCCCDwFD/l9Hy0oE3rseERmvfg9m/TWvjgo3eCioPvQO0y+/8bHoOH1FFDAA y1/G31cKQr7MPNb1Kq0KIB38+xuVm5YMCwlOGwK6TKfdZlvRoxqUYq3Pi3Cht4xpdsof FUKqIvoN+BsUBMNsYZNieURmBYeFshjcx7le8vP1FPzfH46YNWobUdd5JzuxohfrkLuk kO/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765285132; x=1765889932; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Gr+eyGi59A1GxVzaLMCUCbai75PTh6BNoqhkW7rqKHM=; b=Mmtj5c44Mu4Te9TPxKQQnG5Mg6UrsVi+RVTKYtqumMnQPK3K2vSnWhO6q5GDyJjdCy hDjL/XptJvOxIPJIP8vL86Cwuu1JXwbAhBxhEwHxjuxEULbJcNg3cAL2jxv2Hch456Z5 jBs5mCOIj0ZWZ2fql5ACTCJLchDi82G4BDzaA0NrC1Jf5huwgY7EOnOFWwYKvZDAoDfS x3nJwBDz8C/0Ax7/XAp/dwzSk5UHn2XCoW0FBlDhMsUBqyvo0FVxQAWqnZqKKRJyOk8d rTAsDZlvEXaL863dt/xQkfinBXCdeupoioRO4udmyKOz7GIFlBgvM+XpPscxrgrE+/j0 h+fQ== X-Gm-Message-State: AOJu0YzlPZWwVe28Y+u8a+hKharJhykExWVI7HCkmpaJVQ+YLV+LzNMO nPz0ZNHDHr/xXcCLUOLKkVI9Fv/SxrrFhrktobL/M2ge5e6MkXcaQYRMoUYWU8Wo9vVn1ORYM4H vcsFFSeLK7xJqd5vxDaXyn6eBat4Mv4kMNL9FavnpQw== X-Gm-Gg: ASbGncvDPJ6Df9JvvpCozBY/EuO5iw8oejqUIRvbj7Zzw+xk7/6eCI4NsSfVbVNcWP2 D9Kk8DlrbtBkTtV6o6OXs97WAU5J730CjLw+JnHZApd5z/sn/GKBikqg9R1+dtTjTZV0M2sPk/+ pxXOghAKD1UpOizqKbvVUe+/PTfxYsfCxZr6udOCmr+lATQgZww/y6Rnk93Tboja1Pr+LShhDeL KNDMqg/fkypD1jVedWdwurDFClbiANrZIKntxfzvcfU9LDPRcXqpnw7UzwmKgt836x1gA== X-Google-Smtp-Source: AGHT+IEMelxCGO/wEHGz8m5jdB/AezUheJc2gnSI4GO4GenXH32BiQIKNBkeLIP80w2btb4BTIQBzFaErIuExy6djqA= X-Received: by 2002:a05:6512:2215:b0:595:840c:cdcf with SMTP id 2adb3069b0e04-5987568e176mr3873952e87.12.1765285131734; Tue, 09 Dec 2025 04:58:51 -0800 (PST) MIME-Version: 1.0 References: <1bec56e5-aef9-4d3b-b4ee-723c6575a44e@eisentraut.org> In-Reply-To: <1bec56e5-aef9-4d3b-b4ee-723c6575a44e@eisentraut.org> From: Jelte Fennema-Nio Date: Tue, 9 Dec 2025 13:58:40 +0100 X-Gm-Features: AQt7F2rBKwbZWYoeNDf5FyLZ94iz58qGf1jlPA7-znCQfOW47oePEHCo7Kxl9RM Message-ID: Subject: Re: Make copyObject work in C++ To: Peter Eisentraut Cc: PostgreSQL Hackers , Thomas Munro Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 8 Dec 2025 at 08:57, Peter Eisentraut wrote: > In the long run, I would like to change copyObject() to use > typeof_unqual instead, because that handles qualifiers more correctly. > (Currently, copyObject() of a const-qualified pointer results in a > const-qualified pointer, which is nonsensical because the reason you > made the copy is that you can modify it.) See attached patch for an > example. Does C++ have something that is semantically similar to that? Yes, there's a std::remove_cv, std::remove_const, and std::remove_volatile[1]. [1]: https://en.cppreference.com/w/cpp/types/remove_cv.html