Dune Core Modules (2.8.0)

typeutilities.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#ifndef DUNE_COMMON_TYPEUTILITIES_HH
4#define DUNE_COMMON_TYPEUTILITIES_HH
5
6#include <cstddef>
7#include <type_traits>
8#include <tuple>
9
10
11namespace Dune {
12
20 namespace Impl
21 {
22
23 template<class This, class... T>
24 struct disableCopyMoveHelper : public std::is_base_of<This, std::tuple_element_t<0, std::tuple<std::decay_t<T>...>>>
25 {};
26
27 template<class This>
28 struct disableCopyMoveHelper<This> : public std::false_type
29 {};
30
31 } // namespace Impl
32
33
42 template<class This, class... T>
43 using disableCopyMove = std::enable_if_t< not Impl::disableCopyMoveHelper<This, T...>::value, int>;
44
45
46
69 template<std::size_t priority>
70 struct PriorityTag : public PriorityTag<priority-1>
71 {
72 static constexpr std::size_t value = priority;
73 };
74
83 template<>
84 struct PriorityTag<0>
85 {
86 static constexpr std::size_t value = 0;
87 };
88
89
90
91} // namespace Dune
92
93
94
95#endif // DUNE_COMMON_TYPEUTILITIES_HH
std::enable_if_t< not Impl::disableCopyMoveHelper< This, T... >::value, int > disableCopyMove
Helper to disable constructor as copy and move constructor.
Definition: typeutilities.hh:43
Dune namespace.
Definition: alignedallocator.hh:11
Helper class for tagging priorities.
Definition: typeutilities.hh:71
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 22, 23:30, 2024)