@@ -487,7 +487,7 @@ void Contract( const BlockMatrix<T>& A, BlockMatrix<T>& B );
487487template <typename T>
488488void Copy ( const Matrix<T>& A, Matrix<T>& B );
489489template <typename S,typename T,
490- typename =EnableIf<CanCast<S,T>>>
490+ typename =EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >>>
491491void Copy ( const Matrix<S>& A, Matrix<T>& B );
492492
493493template <typename S,typename T,
@@ -501,7 +501,7 @@ void Copy( const BlockMatrix<S>& A, BlockMatrix<T>& B );
501501template <typename T>
502502void Copy ( const AbstractDistMatrix<T>& A, AbstractDistMatrix<T>& B );
503503template <typename S,typename T,
504- typename =EnableIf<CanCast<S,T>>>
504+ typename =EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >>>
505505void Copy ( const AbstractDistMatrix<S>& A, AbstractDistMatrix<T>& B );
506506
507507template <typename T>
@@ -532,7 +532,7 @@ template<typename T>
532532void Copy ( const SparseMatrix<T>& A, SparseMatrix<T>& B );
533533
534534template <typename S,typename T,
535- typename =EnableIf<CanCast<S,T>> >
535+ typename =EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >> >
536536void Copy ( const SparseMatrix<S>& A, SparseMatrix<T>& B );
537537
538538template <typename S,typename T,
@@ -543,7 +543,7 @@ template<typename T>
543543void Copy ( const DistSparseMatrix<T>& A, DistSparseMatrix<T>& B );
544544
545545template <typename S,typename T,
546- typename =EnableIf<CanCast<S,T>>>
546+ typename =EnableIf<And< CanCast<S,T>,Not<IsSame<S,T>> >>>
547547void Copy ( const DistSparseMatrix<S>& A, DistSparseMatrix<T>& B );
548548
549549template <typename S,typename T,
@@ -559,7 +559,7 @@ template<typename T>
559559void Copy ( const DistMultiVec<T>& A, DistMultiVec<T>& B );
560560
561561template <typename S,typename T,
562- typename =EnableIf<CanCast<S,T>>>
562+ typename =EnableIf< And< CanCast<S,T>, Not<IsSame<S,T>> > >>
563563void Copy ( const DistMultiVec<S>& A, DistMultiVec<T>& B );
564564
565565template <typename T>
0 commit comments