Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
utility.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2020 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 #ifndef dealii_cxx14_utility_h
16 #define dealii_cxx14_utility_h
17 
18 #include <deal.II/base/config.h>
19 
20 #include <utility>
21 
22 #ifndef DEAL_II_WITH_CXX14
23 // needed for array type check
24 # include <type_traits>
25 #endif
26 
28 
29 namespace std_cxx14
30 {
31 #ifdef DEAL_II_WITH_CXX14
32  using std::index_sequence;
33  using std::index_sequence_for;
34  using std::make_index_sequence;
35 
36 #else
37 
38  template <size_t... Ints>
39  struct index_sequence
40  {
41  using type = index_sequence;
42  using value_type = size_t;
43  static constexpr std::size_t
44  size() noexcept
45  {
46  return sizeof...(Ints);
47  }
48  };
49 
50  // --------------------------------------------------------------
51  namespace internal
52  {
53  template <class Sequence1, class Sequence2>
54  struct merge_and_renumber;
55 
56  template <size_t... I1, size_t... I2>
57  struct merge_and_renumber<index_sequence<I1...>, index_sequence<I2...>>
58  : index_sequence<I1..., (sizeof...(I1) + I2)...>
59  {};
60  } // namespace internal
61  // --------------------------------------------------------------
62 
63  template <std::size_t N>
64  struct make_index_sequence : internal::merge_and_renumber<
65  typename make_index_sequence<N / 2>::type,
66  typename make_index_sequence<N - N / 2>::type>
67  {};
68 
69  template <>
70  struct make_index_sequence<0> : index_sequence<>
71  {};
72  template <>
73  struct make_index_sequence<1> : index_sequence<0>
74  {};
75 
76  template <class... T>
77  using index_sequence_for = make_index_sequence<sizeof...(T)>;
78 #endif
79 } // namespace std_cxx14
80 
82 
83 #endif // dealii_cxx14_memory_h
value_type
LAPACKSupport::T
static const char T
Definition: lapack_support.h:163
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
config.h
internal
Definition: aligned_vector.h:369
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
std_cxx14
Definition: c++.h:129