public inbox for [email protected]  
help / color / mirror / Atom feed
From: Peter Eisentraut <[email protected]>
To: Jelte Fennema-Nio <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Thomas Munro <[email protected]>
Subject: Re: Make copyObject work in C++
Date: Thu, 19 Feb 2026 09:31:45 +0100
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAGECzQR21OnnKiZO_1rLWO0-16kg1JBxnVq-wymYW0-_1cUNtg@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<ztktlrqatfj4roqhdjurccb3b4mf5hrycybfrzwupt4xmbwjt4@alrtyxhz5sns>
	<[email protected]>
	<2h2n2gyw2f4ucicbl3drtdkjt2wzf6b2r4wqm7xwks6vpx5j7n@imymv4hkz5jz>
	<[email protected]>

On 13.02.26 11:28, Jelte Fennema-Nio wrote:
> Patch 3 makes copyObject work when using GCC or Clang with -std=c++11 by
> introducing pg_exprtype.
> 
> Patch 4 starts using pg_exprtype in more places.

I found this paper

https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2927.htm

which led to the addition of typeof into the C standard.

It contains a section 'Why not "decltype"?' that explains how decltype 
is different, but it also explains that if typeof were added to C++, 
then it would be

     std::remove_reference_t<decltype(T)>

What I suggest we should do here is:

1. Add a configure test that checks if the C++ compiler supports typeof.

2. If not, #define typeof to the above expression.

Then code can continue to use typeof unchanged.







view thread (27+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Make copyObject work in C++
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox