[go: up one dir, main page]

Simplify Documentation by typedef-ing complicated return-types

Submitted by Christoph Hertzberg @chhtz

Assigned to Nobody

Link to original bugzilla bug (#833)
Version: 3.2

Description

Looking at return types like (from http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html#a660200abaf1fc4b888330a37d6132b76)

internal::cast_return_type<Derived,const CwiseUnaryOp<internal::scalar_cast_op<typename internal::traits<Derived>::Scalar, NewType>, const Derived> >::type

is more likely to confuse the average user. We could hide these into \internal typedefs/helper structs like these:
//! \internal Return type of cast()
template<typename NewType>
struct CastReturnType {
typedef /* complicated stuff here */ type;
};

//! cast function:
template<typename NewType>
CastReturnType<NewType>::type cast() const;

Actually, we already do that for many functions.

An additional advantage of this would be to simplify the storage of unevaluated expressions without needing the C++11 auto keyword.

Fixing this is mostly copy-and-paste and does not require deep understanding of Eigen's internals --> JuniorJob

Blocking

#402 #998

Edited by Eigen Bugzilla