Skip to content
Snippets Groups Projects
Commit 495cc85c authored by Carsten Gräser's avatar Carsten Gräser
Browse files

[cleanup] Use Dune::is_indexable

parent b4f1adf8
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment