PMDK C++ bindings 1.13.0
This is the C++ bindings documentation for PMDK's libpmemobj.
Loading...
Searching...
No Matches
array_traits.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2/* Copyright 2016-2018, Intel Corporation */
3
9#ifndef LIBPMEMOBJ_CPP_ARRAY_TRAITS_HPP
10#define LIBPMEMOBJ_CPP_ARRAY_TRAITS_HPP
11
12#include <cstddef>
13
14namespace pmem
15{
16
17namespace detail
18{
19
20/*
21 * Returns the number of array elements.
22 */
23template <typename T>
24struct pp_array_elems {
25 enum { elems = 1 };
26};
27
28/*
29 * Returns the number of array elements.
30 */
31template <typename T, size_t N>
32struct pp_array_elems<T[N]> {
33 enum { elems = N };
34};
35
36/*
37 * Returns the type of elements in an array.
38 */
39template <typename T>
40struct pp_array_type;
41
42/*
43 * Returns the type of elements in an array.
44 */
45template <typename T>
46struct pp_array_type<T[]> {
47 typedef T type;
48};
49
50/*
51 * Returns the type of elements in an array.
52 */
53template <typename T, size_t N>
54struct pp_array_type<T[N]> {
55 typedef T type;
56};
57
58} /* namespace detail */
59
60} /* namespace pmem */
61
62#endif /* LIBPMEMOBJ_CPP_ARRAY_TRAITS_HPP */
Persistent memory namespace.
Definition: allocation_flag.hpp:15