From 01572b9f54e769a7d1bb3d5073c264a5fbc7ce42 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Mon, 10 Mar 2008 17:23:11 +0000 Subject: big change: MatrixBase only takes one template parameter "Derived", the template parameter "Scalar" is removed. This is achieved by introducting a template struct Scalar to achieve a forward-declaration of the Scalar typedefs. --- Eigen/src/Core/CommaInitializer.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Eigen/src/Core/CommaInitializer.h') diff --git a/Eigen/src/Core/CommaInitializer.h b/Eigen/src/Core/CommaInitializer.h index ba64f3f40..b7de3b3aa 100644 --- a/Eigen/src/Core/CommaInitializer.h +++ b/Eigen/src/Core/CommaInitializer.h @@ -29,8 +29,8 @@ /** \internal * Helper class to define the MatrixBase::operator<< */ -template -struct MatrixBase::CommaInitializer +template +struct MatrixBase::CommaInitializer { CommaInitializer(Derived& mat, const Scalar& s) : m_matrix(mat), m_row(0), m_col(1), m_currentBlockRows(1) @@ -39,7 +39,7 @@ struct MatrixBase::CommaInitializer } template - CommaInitializer(Derived& mat, const MatrixBase& other) + CommaInitializer(Derived& mat, const MatrixBase& other) : m_matrix(mat), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) { m_matrix.block(0, 0, other.rows(), other.cols()) = other; @@ -60,7 +60,7 @@ struct MatrixBase::CommaInitializer } template - CommaInitializer& operator,(const MatrixBase& other) + CommaInitializer& operator,(const MatrixBase& other) { if (m_col==m_matrix.cols()) { @@ -94,15 +94,16 @@ struct MatrixBase::CommaInitializer * Example: \include MatrixBase_set.cpp * Output: \verbinclude MatrixBase_set.out */ -template -typename MatrixBase::CommaInitializer MatrixBase::operator<< (const Scalar& s) +template +typename MatrixBase::CommaInitializer MatrixBase::operator<< (const Scalar& s) { - return CommaInitializer(*static_cast(this), s); + return CommaInitializer(*static_cast(this), s); } -template +template template -typename MatrixBase::CommaInitializer MatrixBase::operator<< (const MatrixBase& other) +typename MatrixBase::CommaInitializer +MatrixBase::operator<<(const MatrixBase& other) { return CommaInitializer(*static_cast(this), other); } -- cgit v1.2.3