diff options
author | 2008-10-25 22:38:22 +0000 | |
---|---|---|
committer | 2008-10-25 22:38:22 +0000 | |
commit | e5b8a59cfa5d9d7f81aad80d91c90b613efb2b67 (patch) | |
tree | b1d2d0d0c4b0a74e93e2feb2cbe34e711ff48599 /Eigen/src/Core/util/XprHelper.h | |
parent | 568a7e8eba0cac0555c286aa44a594c109b73276 (diff) |
Add smart cast functions and ctor with scalar conversion (explicit)
to all classes of the Geometry module. By smart I mean that if current
type == new type, then it returns a const reference to *this => zero overhead
Diffstat (limited to 'Eigen/src/Core/util/XprHelper.h')
-rw-r--r-- | Eigen/src/Core/util/XprHelper.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Eigen/src/Core/util/XprHelper.h b/Eigen/src/Core/util/XprHelper.h index 5b8a2c021..676fb9c05 100644 --- a/Eigen/src/Core/util/XprHelper.h +++ b/Eigen/src/Core/util/XprHelper.h @@ -169,4 +169,9 @@ template<typename ExpressionType, int RowsOrSize=Dynamic, int Cols=Dynamic> stru typedef Block<ExpressionType, RowsOrSize, Cols> Type; }; +template<typename CurrentType, typename NewType> struct ei_cast_return_type +{ + typedef typename ei_meta_if<ei_is_same_type<CurrentType,NewType>::ret,const CurrentType&,NewType>::ret type; +}; + #endif // EIGEN_XPRHELPER_H |