dune-istl
2.11
Toggle main menu visibility
Loading...
Searching...
No Matches
dune
istl
allocator.hh
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
2
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
3
#ifndef DUNE_ISTL_ALLOCATOR_HH
4
#define DUNE_ISTL_ALLOCATOR_HH
5
6
#include <memory>
7
#include <type_traits>
8
9
#include <dune/common/typetraits.hh>
10
11
namespace
Dune
{
12
13
template
<
typename
T>
14
struct
exists
{
15
static
const
bool
value
=
true
;
16
};
17
18
template
<
typename
T,
typename
=
void
>
19
struct
DefaultAllocatorTraits
20
{
21
using
type
= std::allocator<T>;
22
};
23
24
template
<
typename
T>
25
struct
DefaultAllocatorTraits
<T,
std
::void_t<typename T::allocator_type> >
26
{
27
using
type
=
typename
T::allocator_type;
28
};
29
30
template
<
typename
T>
31
struct
AllocatorTraits
:
public
DefaultAllocatorTraits
<T> {};
32
33
template
<
typename
T>
34
using
AllocatorType
=
typename
AllocatorTraits<T>::type
;
35
36
template
<
typename
T,
typename
X>
37
using
ReboundAllocatorType
=
typename
std::allocator_traits<typename AllocatorTraits<T>::type>::template rebind_alloc<X>;
38
39
}
// end namespace Dune
40
41
#endif
// DUNE_ISTL_ALLOCATOR_HH
std
STL namespace.
Dune
Definition
allocator.hh:11
Dune::ReboundAllocatorType
typename std::allocator_traits< typename AllocatorTraits< T >::type >::template rebind_alloc< X > ReboundAllocatorType
Definition
allocator.hh:37
Dune::AllocatorType
typename AllocatorTraits< T >::type AllocatorType
Definition
allocator.hh:34
Dune::exists
Definition
allocator.hh:14
Dune::exists::value
static const bool value
Definition
allocator.hh:15
Dune::DefaultAllocatorTraits
Definition
allocator.hh:20
Dune::DefaultAllocatorTraits::type
std::allocator< T > type
Definition
allocator.hh:21
Dune::DefaultAllocatorTraits< T, std::void_t< typename T::allocator_type > >::type
typename T::allocator_type type
Definition
allocator.hh:27
Dune::AllocatorTraits
Definition
allocator.hh:31
Generated by
1.17.0