diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 7ece430ac..82c93f922 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -103,6 +103,21 @@ template struct enable_if; template struct enable_if { typedef T type; }; + + +/** \internal + * A base class do disable default copy ctor and copy assignement operator. + */ +class noncopyable +{ + noncopyable(const noncopyable&); + const noncopyable& operator=(const noncopyable&); +protected: + noncopyable() {} + ~noncopyable() {} +}; + + /** \internal * Convenient struct to get the result type of a unary or binary functor. * diff --git a/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h b/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h index c9ddbda63..32f152634 100644 --- a/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +++ b/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h @@ -51,7 +51,7 @@ namespace Eigen { * see http://www-users.cs.umn.edu/~saad/software/SPARSKIT/README for more details. */ template -class IncompleteLUT +class IncompleteLUT : internal::noncopyable { typedef _Scalar Scalar; typedef typename NumTraits::Real RealScalar; diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h index 90a9675d5..b27ad82ec 100644 --- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h @@ -33,7 +33,7 @@ namespace Eigen { * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner */ template< typename Derived> -class IterativeSolverBase +class IterativeSolverBase : internal::noncopyable { public: typedef typename internal::traits::MatrixType MatrixType; diff --git a/Eigen/src/SuperLUSupport/SuperLUSupport.h b/Eigen/src/SuperLUSupport/SuperLUSupport.h index 60a3eb09a..a3ffa4ef2 100644 --- a/Eigen/src/SuperLUSupport/SuperLUSupport.h +++ b/Eigen/src/SuperLUSupport/SuperLUSupport.h @@ -303,7 +303,7 @@ MappedSparseMatrix map_superlu(SluMatrix& sluMat) * \brief The base class for the direct and incomplete LU factorization of SuperLU */ template -class SuperLUBase +class SuperLUBase : internal::noncopyable { public: typedef _MatrixType MatrixType; diff --git a/Eigen/src/UmfPackSupport/UmfPackSupport.h b/Eigen/src/UmfPackSupport/UmfPackSupport.h index 9b09241b9..84f98ffd3 100644 --- a/Eigen/src/UmfPackSupport/UmfPackSupport.h +++ b/Eigen/src/UmfPackSupport/UmfPackSupport.h @@ -136,7 +136,7 @@ inline int umfpack_get_determinant(std::complex *Mx, double *Ex, void *N * \sa \ref TutorialSparseDirectSolvers */ template -class UmfPackLU +class UmfPackLU : internal::noncopyable { public: typedef _MatrixType MatrixType;