Loading...
Searching...
No Matches
typeutilities.hh
Go to the documentation of this file.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#ifndef DUNE_COMMON_TYPEUTILITIES_HH
#define DUNE_COMMON_TYPEUTILITIES_HH
#include <cstddef>
#include <type_traits>
#include <tuple>
namespace Dune {
namespace Impl
{
template<class This, class... T>
struct disableCopyMoveHelper : public std::is_base_of<This, std::tuple_element_t<0, std::tuple<std::decay_t<T>...>>>
{};
template<class This>
struct disableCopyMoveHelper<This> : public std::false_type
{};
} // namespace Impl
template<class This, class... T>
using disableCopyMove = std::enable_if_t< not Impl::disableCopyMoveHelper<This, T...>::value, int>;
template<std::size_t priority>
struct PriorityTag : public PriorityTag<priority-1>
{
static constexpr std::size_t value = priority;
};
template<>
struct PriorityTag<0>
{
static constexpr std::size_t value = 0;
};
} // namespace Dune
#endif // DUNE_COMMON_TYPEUTILITIES_HH
Dune::disableCopyMove
std::enable_if_t< not Impl::disableCopyMoveHelper< This, T... >::value, int > disableCopyMove
Helper to disable constructor as copy and move constructor.
Definition typeutilities.hh:45
Dune
Dune namespace
Definition alignedallocator.hh:13
Dune::PriorityTag
Helper class for tagging priorities.
Definition typeutilities.hh:73
Dune::PriorityTag::value
static constexpr std::size_t value
Definition typeutilities.hh:74
Dune::PriorityTag< 0 >::value
static constexpr std::size_t value
Definition typeutilities.hh:88