This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[RFC] Should _GLIBCXX_CONSTEXPR, _GLIBCXX14_CONSTEXPR etc. expand to 'inline' ?
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 27 Sep 2019 13:02:44 +0100
- Subject: [RFC] Should _GLIBCXX_CONSTEXPR, _GLIBCXX14_CONSTEXPR etc. expand to 'inline' ?
Currently we have lots of code that has:
inline _GLIBCXX14_CONSTEXPR void
foo()
When the macro expands to 'constexpr' the 'inline' is redundant,
because constexpr implies inline.
For older standards we could make it expand to 'inline' instead of
'constexpr' and then we don't need the sometimes-redundant 'inline'
there.
This would be a change if we have some functions that are *not*
declared 'inline' for older standards, but become inline when they're
constexpr functions. I'm not aware of any cases like that.