Thread

  1. Re: Make copyObject work in C++

    Jelte Fennema-Nio <postgres@jeltef.nl> — 2025-12-08T08:11:59Z

    On Sun Dec 7, 2025 at 8:45 PM CET, Tom Lane wrote:
    > #ifdef __cplusplus
    > #undef typeof
    > #define typeof decltype
    > #define HAVE_TYPEOF 1
    > #endif
    
    Went with defining pg_exprtype (pg_typeof already exists). Undefining
    typeof seemed a bit heavy-handed. Especially since I think it would be
    nice to backport this so C++ extensions can use copyObject directly.
    
    > BTW, grepping finds a number of random references to __typeof__ and
    > __typeof, which probably ought to be updated to be just typeof.
    
    Added a follow on patch that starts using pg_exrtype in all those
    places.