mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix ~1,460 MSVC warnings from generic code instantiated with bool
libeigen/eigen!2364 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -72,7 +72,7 @@ struct evaluator<RealView<Xpr>> : private evaluator<Xpr> {
|
|||||||
static constexpr int CoeffReadCost = BaseEvaluator::CoeffReadCost;
|
static constexpr int CoeffReadCost = BaseEvaluator::CoeffReadCost;
|
||||||
static constexpr int Alignment = BaseEvaluator::Alignment;
|
static constexpr int Alignment = BaseEvaluator::Alignment;
|
||||||
static constexpr bool IsRowMajor = ExpressionTraits::IsRowMajor;
|
static constexpr bool IsRowMajor = ExpressionTraits::IsRowMajor;
|
||||||
static constexpr bool DirectAccess = Flags & DirectAccessBit;
|
static constexpr bool DirectAccess = (Flags & DirectAccessBit) != 0;
|
||||||
|
|
||||||
using ComplexCoeffReturnType = std::conditional_t<DirectAccess, const ComplexScalar&, ComplexScalar>;
|
using ComplexCoeffReturnType = std::conditional_t<DirectAccess, const ComplexScalar&, ComplexScalar>;
|
||||||
using CoeffReturnType = std::conditional_t<DirectAccess, const Scalar&, Scalar>;
|
using CoeffReturnType = std::conditional_t<DirectAccess, const Scalar&, Scalar>;
|
||||||
|
|||||||
@@ -13,6 +13,13 @@
|
|||||||
// IWYU pragma: private
|
// IWYU pragma: private
|
||||||
#include "../InternalHeaderCheck.h"
|
#include "../InternalHeaderCheck.h"
|
||||||
|
|
||||||
|
// C4804: unsafe use of type 'bool' in operation. Unavoidable in generic code
|
||||||
|
// instantiated with bool scalars (e.g. += and * on bool).
|
||||||
|
#if EIGEN_COMP_MSVC
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4804)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@@ -2396,4 +2403,8 @@ inline void setCpuCacheSizes(std::ptrdiff_t l1, std::ptrdiff_t l2, std::ptrdiff_
|
|||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
|
||||||
|
#if EIGEN_COMP_MSVC
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // EIGEN_GENERAL_BLOCK_PANEL_H
|
#endif // EIGEN_GENERAL_BLOCK_PANEL_H
|
||||||
|
|||||||
@@ -13,6 +13,13 @@
|
|||||||
// IWYU pragma: private
|
// IWYU pragma: private
|
||||||
#include "../InternalHeaderCheck.h"
|
#include "../InternalHeaderCheck.h"
|
||||||
|
|
||||||
|
// C4804: unsafe use of type 'bool' in operation. Unavoidable in generic code
|
||||||
|
// instantiated with bool scalars (e.g. += and * on bool).
|
||||||
|
#if EIGEN_COMP_MSVC
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable : 4804)
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Eigen {
|
namespace Eigen {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
@@ -672,4 +679,8 @@ general_matrix_vector_product<Index, LhsScalar, LhsMapper, RowMajor, ConjugateLh
|
|||||||
|
|
||||||
} // end namespace Eigen
|
} // end namespace Eigen
|
||||||
|
|
||||||
|
#if EIGEN_COMP_MSVC
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // EIGEN_GENERAL_MATRIX_VECTOR_H
|
#endif // EIGEN_GENERAL_MATRIX_VECTOR_H
|
||||||
|
|||||||
Reference in New Issue
Block a user