dune-common
2.6-git
dune
common
forloop.hh
Go to the documentation of this file.
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
// vi: set et ts=4 sw=2 sts=2:
3
4
#warning The header dune/common/forloop.hh is deprecated. Use directly "Hybrid::forEach" and include dune/common/hybridutilities.hh.
5
6
#ifndef DUNE_COMMON_FORLOOP_HH
7
#define DUNE_COMMON_FORLOOP_HH
8
9
#include <utility>
10
11
#include <
dune/common/deprecated.hh
>
12
#include <
dune/common/hybridutilities.hh
>
13
#include <
dune/common/std/utility.hh
>
14
15
namespace
Dune
16
{
17
18
template
<
template
<
int
>
class
Operation,
int
first,
int
last >
19
struct
DUNE_DEPRECATED_MSG
("Use Hybrid::forEach instead!") ForLoop
20
{
21
static_assert( (first <= last),
"ForLoop: first > last"
);
22
23
template
<
typename
... Args>
24
static
void
apply
(Args&&... args)
25
{
26
Hybrid::forEach
(Std::make_index_sequence<last+1-first>{},
27
[&](
auto
i){
Operation<i+first>::apply
(args...);});
28
}
29
};
30
31
}
32
33
#endif // #ifndef DUNE_COMMON_FORLOOP_HH
Dune::Hybrid::forEach
constexpr void forEach(Range &&range, F &&f)
Range based for loop.
Definition:
hybridutilities.hh:308
Dune::Std::apply
decltype(auto) apply(F &&f, ArgTuple &&args)
Apply function with arguments given as tuple.
Definition:
apply.hh:58
Dune
Dune namespace.
Definition:
alignedallocator.hh:9
Dune::DUNE_DEPRECATED_MSG
DUNE_DEPRECATED_MSG("Use Dune::filledArray() from <dune/common/filledarray.hh>") std
Create an array and fill it with copies of the provided value.
Definition:
array.hh:51
utility.hh
hybridutilities.hh
deprecated.hh
Definition of the DUNE_DEPRECATED macro for the case that config.h is not available.
Generated by
1.8.17