dune-fem 2.12-git
Loading...
Searching...
No Matches
forloop.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_FORLOOP_HH
2#define DUNE_FEM_FORLOOP_HH
3
4#include <utility>
5
9
10namespace Dune
11{
12
13 namespace Fem {
14
15 template< template< int > class Operation, int first, int last >
16 struct ForLoop
17 {
18 static_assert( (first <= last), "Fem::Fem::ForLoop: first > last" );
19
20 static const std::size_t N = last + 1 - first;
21
22 template<typename... Args>
23 static DUNE_PRIVATE void apply(Args&&... args)
24 {
26 [&](auto i){Operation<i+first>::apply(args...);});
27 }
28 };
29
30 } // end namespace Fem
31} // end namespace Dune
32#endif // #ifndef DUNE_FEM_FORLOOP_HH
#define DUNE_PRIVATE
constexpr void forEach(Range &&range, F &&f)
Definition forloop.hh:17
static DUNE_PRIVATE void apply(Args &&... args)
Definition forloop.hh:23
static const std::size_t N
Definition forloop.hh:20