Project
Loading...
Searching...
No Matches
StaticFor.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_FRAMEWORK_STATICFOR_H_
13#define O2_FRAMEWORK_STATICFOR_H_
14
15namespace o2::framework
16{
17namespace staticFor_details
18{
19template <int FirstIndex, std::size_t... IndexSequence, typename F>
20void applyFunction(F const& f, std::index_sequence<IndexSequence...>)
21{
22 (f(std::integral_constant<int, FirstIndex + IndexSequence>{}), ...);
23}
24} // namespace staticFor_details
25
26template <int FirstIndex, int LastIndex, typename IndexSequence = std::make_index_sequence<(LastIndex - FirstIndex) + 1>, typename F>
27static inline constexpr void static_for(F const& f)
28{
29 staticFor_details::applyFunction<FirstIndex>(f, IndexSequence{});
30}
31} // namespace o2::framework
32
33#endif // O2_FRAMEWORK_STATICFOR_H_
GLdouble f
Definition glcorearb.h:310
void applyFunction(F const &f, std::index_sequence< IndexSequence... >)
Definition StaticFor.h:20
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20