Add is_constant_evaluated, update alignment checks

This commit is contained in:
Tobias Schlüter
2022-03-25 04:00:58 +00:00
committed by Antonio Sánchez
parent f0a91838aa
commit e22d58e816
3 changed files with 13 additions and 4 deletions

View File

@@ -508,6 +508,14 @@ inline constexpr bool logical_xor(bool a, bool b) {
inline constexpr bool check_implication(bool a, bool b) {
return !a || b;
}
/// \internal Provide fallback for std::is_constant_evaluated for pre-C++20.
#if EIGEN_COMP_CXXVER >= 20
using std::is_constant_evaluated;
#else
constexpr bool is_constant_evaluated() { return false; }
#endif
} // end namespace internal
} // end namespace Eigen