Visual Computing Library
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_CONCEPTS_POINTERS_H
24#define VCL_CONCEPTS_POINTERS_H
25
26#include "const_correctness.h"
27
28#include <memory>
29
30namespace vcl {
31
32namespace detail {
33
34template<typename T>
35struct IsSharedPtr : std::false_type
36{
37};
38
39template<typename T>
40struct IsSharedPtr<std::shared_ptr<T>> : std::true_type
41{
42};
43
44} // namespace detail
45
52template<typename T>
53concept IsPointer = std::is_pointer_v<RemoveRef<T>>;
54
60template<typename T>
61concept IsSharedPointer = detail::IsSharedPtr<T>::value;
62
69template<typename T>
71
80template<typename T>
82
89template<typename T>
92
99template<typename T>
101
102} // namespace vcl
103
104#endif // VCL_CONCEPTS_POINTERS_H
The IsAnyPointerToConst concept is satisfied if T is a Pointer or a shared pointer to a constant obje...
Definition pointers.h:100
The IsAnyPointer concept is satisfied if T is a Pointer or a shared pointer.
Definition pointers.h:70
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:81
The IsPointer concept is satisfied if T is a Pointer, even if the type T is a reference to a pointer.
Definition pointers.h:53
The IsSharedPointerToConst concept is satisfied if T is a shared pointer to a constant object.
Definition pointers.h:90
The IsSharedPointer concept is satisfied if T is a shared pointer.
Definition pointers.h:61