Dune Core Modules (2.7.0)

allocator.hh
1#ifndef DUNE_ISTL_ALLOCATOR_HH
2#define DUNE_ISTL_ALLOCATOR_HH
3
5#include <memory>
6
7namespace Dune {
8
9 template<typename T>
10 struct exists{
11 static const bool value = true;
12 };
13
14 template<typename T, typename = void>
15 struct DefaultAllocatorTraits
16 {
17 using type = std::allocator<T>;
18 };
19
20 template<typename T>
21 struct DefaultAllocatorTraits<T, void_t<typename T::allocator_type> >
22 {
23 using type = typename T::allocator_type;
24 };
25
26 template<typename T>
27 struct AllocatorTraits : public DefaultAllocatorTraits<T> {};
28
29 template<typename T>
30 using AllocatorType = typename AllocatorTraits<T>::type;
31
32 template<typename T, typename X>
33 using ReboundAllocatorType = typename AllocatorTraits<T>::type::template rebind<X>::other;
34
35} // end namespace Dune
36
37#endif // DUNE_ISTL_ALLOCATOR_HH
typename Impl::voider< Types... >::type void_t
Is void for all valid input types (see N3911). The workhorse for C++11 SFINAE-techniques.
Definition: typetraits.hh:40
Dune namespace.
Definition: alignedallocator.hh:14
Traits for type conversions and type information.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)