PMDK C++ bindings 1.13.0
This is the C++ bindings documentation for PMDK's libpmemobj.
Loading...
Searching...
No Matches
check_persistent_ptr_array.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_CHECK_PERSISTENT_PTR_ARRAY_HPP
10#define LIBPMEMOBJ_CPP_CHECK_PERSISTENT_PTR_ARRAY_HPP
11
12#include <cstddef>
13
15
16namespace pmem
17{
18
19namespace detail
20{
21
22/*
23 * Typedef checking if given type is not an array.
24 */
25template <typename T>
26struct pp_if_not_array {
27 typedef obj::persistent_ptr<T> type;
28};
29
30/*
31 * Typedef checking if given type is not an array.
32 */
33template <typename T>
34struct pp_if_not_array<T[]> {
35};
36
37/*
38 * Typedef checking if given type is not an array.
39 */
40template <typename T, size_t N>
41struct pp_if_not_array<T[N]> {
42};
43
44/*
45 * Typedef checking if given type is an array.
46 */
47template <typename T>
48struct pp_if_array;
49
50/*
51 * Typedef checking if given type is an array.
52 */
53template <typename T>
54struct pp_if_array<T[]> {
55 typedef obj::persistent_ptr<T[]> type;
56};
57
58/*
59 * Typedef checking if given type is an array.
60 */
61template <typename T>
62struct pp_if_size_array;
63
64/*
65 * Typedef checking if given type is an array.
66 */
67template <typename T, size_t N>
68struct pp_if_size_array<T[N]> {
69 typedef obj::persistent_ptr<T[N]> type;
70};
71
72} /* namespace detail */
73
74} /* namespace pmem */
75
76#endif /* LIBPMEMOBJ_CPP_CHECK_PERSISTENT_PTR_ARRAY_HPP */
Persistent memory namespace.
Definition: allocation_flag.hpp:15
Persistent smart pointer.