Re: unconstify()/unvolatize() vs g++/clang++

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: unconstify()/unvolatize() vs g++/clang++
Дата
Msg-id 47f623a0-8d66-48cd-8dd4-58e3db603a02@eisentraut.org
обсуждение исходный текст
Ответ на unconstify()/unvolatize() vs g++/clang++  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: unconstify()/unvolatize() vs g++/clang++  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
On 11.12.23 01:42, Thomas Munro wrote:
> AFAICS you can't use unconstify()/unvolatize() in a static inline
> function in a .h file, or in a .cpp file, because
> __builtin_types_compatible_p is only available in C, not C++.  Seems
> like a reasonable thing to want to be able to do, no?  I'm not
> immediately sure what the right fix is; would #if
> defined(HAVE__BUILTIN_TYPES_COMPATIBLE_P) && !defined(__cplusplus)
> around the relevant versions of constify()/unvolatize() be too easy?

That seems right to me.

If you are slightly more daring, you can write an alternative definition 
in C++ using const_cast?




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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: Streaming I/O, vectored I/O (WIP)
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Streaming I/O, vectored I/O (WIP)