mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 11:49:02 +08:00
Improved compilation errors for Transform initialization/assignment with different numeric types.
This commit is contained in:
parent
3a2cabc275
commit
3431c052c6
@ -279,6 +279,9 @@ public:
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline explicit Transform(const EigenBase<OtherDerived>& other)
|
inline explicit Transform(const EigenBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
EIGEN_STATIC_ASSERT((internal::is_same<Scalar,typename OtherDerived::Scalar>::value),
|
||||||
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
|
||||||
|
|
||||||
check_template_params();
|
check_template_params();
|
||||||
internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
|
internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
|
||||||
}
|
}
|
||||||
@ -287,6 +290,9 @@ public:
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline Transform& operator=(const EigenBase<OtherDerived>& other)
|
inline Transform& operator=(const EigenBase<OtherDerived>& other)
|
||||||
{
|
{
|
||||||
|
EIGEN_STATIC_ASSERT((internal::is_same<Scalar,typename OtherDerived::Scalar>::value),
|
||||||
|
YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY);
|
||||||
|
|
||||||
internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
|
internal::transform_construct_from_matrix<OtherDerived,Mode,Options,Dim,HDim>::run(this, other.derived());
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user