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
This commit is contained in:
Gael Guennebaud
2008-10-25 22:38:22 +00:00
parent 568a7e8eba
commit e5b8a59cfa
9 changed files with 361 additions and 224 deletions

View File

@@ -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