remove EIGEN_REF_TO_TEMPORARY, clarify docs

This commit is contained in:
Benoit Jacob
2010-12-25 16:45:25 -05:00
parent 75b7d98665
commit 86d3711fb7
7 changed files with 12 additions and 19 deletions

View File

@@ -230,7 +230,7 @@ class Array
* data pointers.
*/
template<typename OtherDerived>
void swap(ArrayBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
void swap(ArrayBase<OtherDerived> const & other)
{ this->_swap(other.derived()); }
inline Index innerStride() const { return 1; }

View File

@@ -323,7 +323,7 @@ class Matrix
* of same type it is enough to swap the data pointers.
*/
template<typename OtherDerived>
void swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
void swap(MatrixBase<OtherDerived> const & other)
{ this->_swap(other.derived()); }
inline Index innerStride() const { return 1; }

View File

@@ -526,7 +526,7 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
* data pointers.
*/
template<typename OtherDerived>
void _swap(DenseBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
void _swap(DenseBase<OtherDerived> const & other)
{
enum { SwapPointers = internal::is_same<Derived, OtherDerived>::value && Base::SizeAtCompileTime==Dynamic };
internal::matrix_swap_impl<Derived, OtherDerived, bool(SwapPointers)>::run(this->derived(), other.const_cast_derived());

View File

@@ -324,13 +324,13 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView
}
template<typename OtherDerived>
void swap(TriangularBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
void swap(TriangularBase<OtherDerived> const & other)
{
TriangularView<SwapWrapper<MatrixType>,Mode>(const_cast<MatrixType&>(m_matrix)).lazyAssign(other.derived());
}
template<typename OtherDerived>
void swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other)
void swap(MatrixBase<OtherDerived> const & other)
{
TriangularView<SwapWrapper<MatrixType>,Mode>(const_cast<MatrixType&>(m_matrix)).lazyAssign(other.derived());
}

View File

@@ -263,13 +263,6 @@
// needed to define it here as escaping characters in CMake add_definition's argument seems very problematic.
#define EIGEN_DOCS_IO_FORMAT IOFormat(3, 0, " ", "\n", "", "")
// C++0x features
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
#define EIGEN_REF_TO_TEMPORARY const &
#else
#define EIGEN_REF_TO_TEMPORARY const &
#endif
#if defined(_MSC_VER) && (!defined(__INTEL_COMPILER))
#define EIGEN_INHERIT_ASSIGNMENT_EQUAL_OPERATOR(Derived) \
using Base::operator =;

View File

@@ -573,7 +573,7 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
{ return typename internal::eval<Derived>::type(derived()); }
// template<typename OtherDerived>
// void swap(MatrixBase<OtherDerived> EIGEN_REF_TO_TEMPORARY other);
// void swap(MatrixBase<OtherDerived> const & other);
// template<unsigned int Added>
// const SparseFlagged<Derived, Added, 0> marked() const;