Dune Core Modules (2.6.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
81 template<>
82 struct PriorityTag<0>
83 {};
84
85
86
87} // namespace Dune
88
89
90
91#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:10
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 26, 23:30, 2024)