aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Transpose.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-09-23 14:28:23 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-09-23 14:28:23 +0200
commit36448c9e287935b8c408791bf88b2907292d6c80 (patch)
tree841afdf4ea165433ad3b0f797498441815344eeb /Eigen/src/Core/Transpose.h
parentde0d8a010e8cee66901786e0e2819beeaa5cb253 (diff)
Make constructors explicit if they could lead to unintended implicit conversion
Diffstat (limited to 'Eigen/src/Core/Transpose.h')
-rw-r--r--Eigen/src/Core/Transpose.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h
index 144bb2c01..57d6fd2fe 100644
--- a/Eigen/src/Core/Transpose.h
+++ b/Eigen/src/Core/Transpose.h
@@ -64,7 +64,7 @@ template<typename MatrixType> class Transpose
typedef typename internal::remove_all<MatrixType>::type NestedExpression;
EIGEN_DEVICE_FUNC
- inline Transpose(MatrixType& a_matrix) : m_matrix(a_matrix) {}
+ explicit inline Transpose(MatrixType& a_matrix) : m_matrix(a_matrix) {}
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Transpose)
@@ -169,7 +169,7 @@ template<typename Derived>
inline Transpose<Derived>
DenseBase<Derived>::transpose()
{
- return derived();
+ return TransposeReturnType(derived());
}
/** This is the const version of transpose().
@@ -207,8 +207,7 @@ template<typename Derived>
inline const typename MatrixBase<Derived>::AdjointReturnType
MatrixBase<Derived>::adjoint() const
{
- return this->transpose(); // in the complex case, the .conjugate() is be implicit here
- // due to implicit conversion to return type
+ return AdjointReturnType(this->transpose());
}
/***************************************************************************