[HACKERS] static assertions in C++

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема [HACKERS] static assertions in C++
Дата
Msg-id 0de63a5f-6e05-56c9-b4d9-55c41d07ebc9@2ndquadrant.com
обсуждение исходный текст
Ответы Re: [HACKERS] static assertions in C++  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Commit df1a699e5ba3232f373790b2c9485ddf720c4a70 introduced a
StaticAssertStmt() into a header file, which will fail if a module
written in C++ uses that header file.  Currently, that header file is
not widely used, but it's a potential problem if the use of static
assertions expands.

As discussed in
<https://www.postgresql.org/message-id/7775.1492448671@sss.pgh.pa.us>, a
more general solution would be to add specific C++ support for static
assertions in c.h.  Here is a patch for that, extracted from my
previously posted C++ patch set, but also a bit reworked from what was
previously posted.

Also attached is a little C++ test file that one can use to test this
out.  (Just compiling it should cause a compiler error without the patch
and a static assertion failure with the patch.)

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] sync process names between ps and pg_stat_activity
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] static assertions in C++