Lagrange
default_delete.h
1
// Source: https://github.com/X-czh/smart_ptr
2
// SPDX-License-Identifier: MIT
3
//
4
// This file has been modified by Adobe.
5
//
6
// All modifications are Copyright 2022 Adobe.
7
8
// default_delete is the default destruction policy used by
9
// unique_ptr & shared_ptr when no deleter is specified.
10
11
#pragma once
12
13
namespace
lagrange::internal
{
14
15
// 20.7.1.1 Default deleters
16
17
// 20.7.1.1.2, default_delete
18
19
template
<
typename
T>
20
class
default_delete
21
{
22
public
:
24
constexpr
default_delete
() noexcept = default;
25
27
template <typename U>
28
default_delete
(const
default_delete
<U>&) noexcept
29
{}
30
32
void
operator()
(T* p)
const
{
delete
p; }
33
};
34
35
// 20.7.1.1.3, default_delete<T[]>
36
37
template
<
typename
T>
38
class
default_delete
<T[]>
39
{
40
public
:
42
constexpr
default_delete
() noexcept = default;
43
45
template <typename U>
46
default_delete
(const
default_delete
<U[]>&) noexcept
47
{}
48
50
void
operator()
(T* p)
const
{
delete
[] p; }
51
};
52
53
}
// namespace lagrange::internal
lagrange::internal::default_delete< T[]>::default_delete
constexpr default_delete() noexcept=default
Default constructor.
lagrange::internal::default_delete< T[]>::operator()
void operator()(T *p) const
Call operator.
Definition:
default_delete.h:50
lagrange::internal::default_delete
Definition:
default_delete.h:21
lagrange::internal::default_delete::default_delete
constexpr default_delete() noexcept=default
Default constructor.
lagrange::internal::default_delete::operator()
void operator()(T *p) const
Call operator.
Definition:
default_delete.h:32
lagrange::internal
nullptr_t, size_t, ptrdiff_t basic_ostream bad_weak_ptr extent, remove_extent, is_array,...
Definition:
attribute_string_utils.h:21
lagrange
internal
smart_ptr
default_delete.h
Generated by
1.9.4