mirror of
https://github.com/boostorg/config.git
synced 2025-07-30 04:17:16 +02:00
Added BOOST_INLINE_VARIABLE macro.
The BOOST_INLINE_VARIABLE macro can be used to mark C++17 inline variables in contexts where omitting the inline keyword is still acceptable on older compilers. This commit also adds the missing docs for BOOST_NO_CXX17_INLINE_VARIABLES.
This commit is contained in:
@ -936,7 +936,7 @@ provide compliant C++14 support.
|
|||||||
|
|
||||||
[table
|
[table
|
||||||
[[Macro ][ Description ]]
|
[[Macro ][ Description ]]
|
||||||
[[`BOOST_CXX14_CONSTEXPR`][This macro works similar to BOOST_CONSTEXPR, but expands to `constexpr` only if the C++14 "relaxed" `constexpr` is available.]]
|
[[`BOOST_CXX14_CONSTEXPR`][This macro works similar to `BOOST_CONSTEXPR`, but expands to `constexpr` only if the C++14 "relaxed" `constexpr` is available.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
@ -955,6 +955,21 @@ that are not yet supported by a particular compiler or library.
|
|||||||
[[`BOOST_NO_CXX17_STD_INVOKE`][The compiler does not support `std::invoke()`.]]
|
[[`BOOST_NO_CXX17_STD_INVOKE`][The compiler does not support `std::invoke()`.]]
|
||||||
[[`BOOST_NO_CXX17_ITERATOR_TRAITS`][The compiler does not support SFINAE-friendly `std::iterator_traits`.]]
|
[[`BOOST_NO_CXX17_ITERATOR_TRAITS`][The compiler does not support SFINAE-friendly `std::iterator_traits`.]]
|
||||||
[[`BOOST_NO_CXX17_IF_CONSTEXPR`][The compiler does not support `if constexpr`.]]
|
[[`BOOST_NO_CXX17_IF_CONSTEXPR`][The compiler does not support `if constexpr`.]]
|
||||||
|
[[`BOOST_NO_CXX17_INLINE_VARIABLES`][The compiler does not support `inline` variables.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
[#config_17_for_14]
|
||||||
|
|
||||||
|
[section Macros that allow use of C++17 features with C++14 or earlier compilers]
|
||||||
|
|
||||||
|
The following macros allow use of C++17 features even with compilers that do not yet
|
||||||
|
provide compliant C++17 support.
|
||||||
|
|
||||||
|
[table
|
||||||
|
[[Macro ][ Description ]]
|
||||||
|
[[`BOOST_INLINE_VARIABLE`][This macro expands to `inline` on compilers that support C++17 inline variables and to nothing otherwise. Users may need to check for `BOOST_NO_CXX17_INLINE_VARIABLES` for further adjustments to the code.]]
|
||||||
]
|
]
|
||||||
|
|
||||||
[endsect]
|
[endsect]
|
||||||
|
@ -986,6 +986,15 @@ namespace std{ using ::type_info; }
|
|||||||
#define BOOST_CXX14_CONSTEXPR constexpr
|
#define BOOST_CXX14_CONSTEXPR constexpr
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// C++17 inline variables
|
||||||
|
//
|
||||||
|
#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
|
||||||
|
#define BOOST_INLINE_VARIABLE inline
|
||||||
|
#else
|
||||||
|
#define BOOST_INLINE_VARIABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// Unused variable/typedef workarounds:
|
// Unused variable/typedef workarounds:
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user