DUNE
Dune-Functions
2.12-git
Loading...
Searching...
No Matches
staticforloop.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
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file AUTHORS.md
5
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception OR LGPL-3.0-or-later
6
7
#ifndef DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
8
#define DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
9
10
11
#include <
dune/common/concept.hh
>
12
13
#include <
dune/functions/common/type_traits.hh
>
14
#include <
dune/functions/functionspacebases/concepts.hh
>
15
16
17
namespace
Dune
{
18
namespace
Functions {
19
20
namespace
Imp {
21
22
template
<
class
ST, ST begin, ST end>
23
struct
StaticFindInRange
24
{
25
template
<
class
F,
class
...Args>
26
static
void
apply
(F&& f, Args&&... args)
27
{
28
if
(f(
std::integral_constant<ST, begin>
(), std::forward<Args>(args)...))
29
return
;
30
StaticFindInRange<ST, begin+1, end>::apply(std::forward<F>(f), std::forward<Args>(args)...);
31
}
32
};
33
34
template
<
class
ST, ST end>
35
struct
StaticFindInRange<ST,
end
,
end
>
36
{
37
template
<
class
F,
class
...Args>
38
static
void
apply
(F&& f, Args&&...)
39
{}
40
};
41
42
}
//end namespace Imp
43
44
45
59
template
<
std::size_t
begin_t,
std::size_t
end_t,
class
F,
class
... Args>
60
void
staticFindInRange
(F&& f, Args&&... args)
61
{
62
Imp::StaticFindInRange<std::size_t, begin_t, end_t>::apply(std::forward<F>(f), std::forward<Args>(args)...);
63
}
64
65
66
}
// namespace Dune::Functions
67
}
// namespace Dune
68
69
70
71
#endif
//DUNE_FUNCTIONS_COMMON_STATICFORLOOP_HH
type_traits.hh
Dune::Functions::staticFindInRange
void staticFindInRange(F &&f, Args &&... args)
Static find loop.
Definition
staticforloop.hh:60
concept.hh
Dune
end
iterator end()
concepts.hh
std::apply
T apply(T... args)
std::integral_constant
std::size_t
dune-functions
dune
functions
common
staticforloop.hh
Legal Statements / Impressum
| Hosted by
TU Dresden
&
Uni Heidelberg
| Generated by
1.9.8