Visual Computing Library  devel
Loading...
Searching...
No Matches
pointers.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_BASE_CONCEPTS_POINTERS_H
24#define VCL_BASE_CONCEPTS_POINTERS_H
25
26#include <vclib/base/concepts/const_correctness.h>
27#include <vclib/base/pointers.h>
28
29#include <memory>
30
31namespace vcl {
32
33namespace detail {
34
35template<typename T>
36struct IsSharedPtr : std::false_type
37{
38};
39
40template<typename T>
41struct IsSharedPtr<std::shared_ptr<T>> : std::true_type
42{
43};
44
45} // namespace detail
46
53template<typename T>
54concept IsPointer = std::is_pointer_v<RemoveRef<T>>;
55
61template<typename T>
62concept IsSharedPointer = detail::IsSharedPtr<T>::value;
63
70template<typename T>
72
81template<typename T>
83
90template<typename T>
93
100template<typename T>
102
103} // namespace vcl
104
105#endif // VCL_BASE_CONCEPTS_POINTERS_H
The IsAnyPointerToConst concept is satisfied if T is a Pointer or a shared pointer to a constant obje...
Definition pointers.h:101
The IsAnyPointer concept is satisfied if T is a Pointer or a shared pointer.
Definition pointers.h:71
The IsConst concept is satisfied if T satisfies one of the following conditions:
Definition const_correctness.h:43
The IsPointerToConst concept is satisfied if T is a Pointer to a constant object.
Definition pointers.h:82
The IsPointer concept is satisfied if T is a Pointer, even if the type T is a reference to a pointer.
Definition pointers.h:54
The IsSharedPointerToConst concept is satisfied if T is a shared pointer to a constant object.
Definition pointers.h:91
The IsSharedPointer concept is satisfied if T is a shared pointer.
Definition pointers.h:62