Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ambiguous template special. errors with GCC 7+ #264

Merged
merged 1 commit into from
Aug 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/El/blas_like/level1/decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ void Contract( const BlockMatrix<T>& A, BlockMatrix<T>& B );
template<typename T>
void Copy( const Matrix<T>& A, Matrix<T>& B );
template<typename S,typename T,
typename=EnableIf<CanCast<S,T>>>
typename=EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >>>
void Copy( const Matrix<S>& A, Matrix<T>& B );

template<typename S,typename T,
Expand All @@ -501,7 +501,7 @@ void Copy( const BlockMatrix<S>& A, BlockMatrix<T>& B );
template<typename T>
void Copy( const AbstractDistMatrix<T>& A, AbstractDistMatrix<T>& B );
template<typename S,typename T,
typename=EnableIf<CanCast<S,T>>>
typename=EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >>>
void Copy( const AbstractDistMatrix<S>& A, AbstractDistMatrix<T>& B );

template<typename T>
Expand Down Expand Up @@ -532,7 +532,7 @@ template<typename T>
void Copy( const SparseMatrix<T>& A, SparseMatrix<T>& B );

template<typename S,typename T,
typename=EnableIf<CanCast<S,T>>>
typename=EnableIf<And< CanCast<S,T>, Not<IsSame<S,T>> >> >
void Copy( const SparseMatrix<S>& A, SparseMatrix<T>& B );

template<typename S,typename T,
Expand All @@ -543,7 +543,7 @@ template<typename T>
void Copy( const DistSparseMatrix<T>& A, DistSparseMatrix<T>& B );

template<typename S,typename T,
typename=EnableIf<CanCast<S,T>>>
typename=EnableIf<And<CanCast<S,T>,Not<IsSame<S,T>>>>>
void Copy( const DistSparseMatrix<S>& A, DistSparseMatrix<T>& B );

template<typename S,typename T,
Expand All @@ -559,7 +559,7 @@ template<typename T>
void Copy( const DistMultiVec<T>& A, DistMultiVec<T>& B );

template<typename S,typename T,
typename=EnableIf<CanCast<S,T>>>
typename=EnableIf< And< CanCast<S,T>, Not<IsSame<S,T>> > >>
void Copy( const DistMultiVec<S>& A, DistMultiVec<T>& B );

template<typename T>
Expand Down
10 changes: 10 additions & 0 deletions include/El/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ enum FortranLogicalEnum
template<typename S,typename T>
using IsSame = std::is_same<S,T>;

template<typename S, typename T>
struct And {
static constexpr bool value = S::value && T::value;
};

template<typename T>
struct Not {
static constexpr bool value = !T::value;
};

template<typename Condition,class T=void>
using EnableIf = typename std::enable_if<Condition::value,T>::type;
template<typename Condition,class T=void>
Expand Down
Loading