DUNE-FEM (unstable)

forloop.hh
1#ifndef DUNE_FEM_FORLOOP_HH
2#define DUNE_FEM_FORLOOP_HH
3
4#include <utility>
5
8#include <dune/common/hybridutilities.hh>
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 {
25 Dune::Hybrid::forEach(std::make_index_sequence<N>{},
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
Definition of the DUNE_NO_DEPRECATED_* macros.
constexpr void forEach(Range &&range, F &&f)
Range based for loop.
Definition: hybridutilities.hh:256
Dune namespace.
Definition: alignedallocator.hh:13
Definition of macros controlling symbol visibility at the ABI level.
#define DUNE_PRIVATE
Mark a symbol as being for internal use within the current DSO only.
Definition: visibility.hh:28
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)