diff --git a/dune/solvers/common/resize.hh b/dune/solvers/common/resize.hh index 5bcda098711d2b9b6298ffb6326a3a1930b53e0e..a1bbeafa5f88fb7d3238350d6170c226999f82f8 100644 --- a/dune/solvers/common/resize.hh +++ b/dune/solvers/common/resize.hh @@ -5,6 +5,7 @@ #include <dune/common/indices.hh> #include <dune/common/concept.hh> +#include <dune/common/typetraits.hh> #include <dune/solvers/common/defaultbitvector.hh> @@ -13,27 +14,6 @@ namespace Dune { namespace Solvers { -namespace Concept { - -struct HasResize -{ - template<class C> - auto require(C&& c) -> decltype( - c.resize(0) - ); -}; - -template<class Index> -struct HasBracketOperator -{ - template<class T> - auto require(T&& t) -> decltype( - t[std::declval<Index>()] - ); -}; - -} // namespace Concept - namespace Impl { @@ -49,14 +29,14 @@ void resizeInitialize(Dune::BitSetVector<size, Alloc>& x, const Vector& y, bool } template<class TargetVector, class Vector, class Value, - std::enable_if_t<not models<Dune::Solvers::Concept::HasBracketOperator<std::integral_constant<std::size_t,0> >, TargetVector>(), int> = 0> + std::enable_if_t<not Dune::is_indexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0> void resizeInitialize(TargetVector& x, const Vector& y, const Value& value) { x = value; } template<class TargetVector, class Vector, class Value, - std::enable_if_t< models<Dune::Solvers::Concept::HasBracketOperator<std::integral_constant<std::size_t,0> >, TargetVector>(), int> = 0> + std::enable_if_t<Dune::is_indexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0> void resizeInitialize(TargetVector& x, const Vector& y, const Value& value) { namespace H = Dune::Hybrid;