Re: Make copyObject work in C++

Поиск
Список
Период
Сортировка
От Jelte Fennema-Nio
Тема Re: Make copyObject work in C++
Дата
Msg-id CAGECzQSgRGRRHt4BVhMLpxrXMGDGzFLk3d=rnC7ye2kNibc-AQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Make copyObject work in C++  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
On Mon, 8 Dec 2025 at 08:57, Peter Eisentraut <peter@eisentraut.org> 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



В списке pgsql-hackers по дате отправления: