Skip to content
Snippets Groups Projects
Commit 3127e1a4 authored by Max Kahnt's avatar Max Kahnt
Browse files

Compile-time expression is now in trait utilities.

parent 02ffbc31
Branches
No related tags found
No related merge requests found
......@@ -3,20 +3,12 @@
#ifndef DUNE_MATRIX_VECTOR_ALGORITHM_HH
#define DUNE_MATRIX_VECTOR_ALGORITHM_HH
#include <type_traits>
#include <dune/common/hybridutilities.hh>
#include <dune/common/typetraits.hh>
#include <dune/common/std/type_traits.hh>
#include <dune/matrix-vector/traitutilities.hh>
namespace Dune {
namespace MatrixVector {
template<class T>
constexpr auto isTupleOrDerived() {
return Std::bool_constant<IsTupleOrDerived<std::decay_t<T>>::value>();
}
//! \brief Hybrid for loop over sparse range (static/tuple-like candidate)
template <class Range, class F, std::enable_if_t<isTupleOrDerived<Range>(), int> = 0>
void sparseRangeFor(Range&& range, F&& f) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment