treewide: avoid use of unsupported C++ specifiers

constexpr and noexcept were introduced as specifiers in C++11.  Avoid
referencing them when compiling for earlier versions of the language.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
This commit is contained in:
Peter A. Bigot 2019-12-13 04:27:44 -06:00 committed by Maureen Helm
commit 6ade720851
2 changed files with 14 additions and 5 deletions

View file

@ -50,7 +50,10 @@
#if defined(__cplusplus)
template < class T, size_t N >
constexpr size_t ARRAY_SIZE(T(&)[N]) { return N; }
#if __cplusplus >= 201103L
constexpr
#endif /* >= C++11 */
size_t ARRAY_SIZE(T(&)[N]) { return N; }
#else
/* Evaluates to number of elements in an array; compile error if not