Blender
V4.3
source
blender
freestyle
intern
view_map
AutoPtrHelper.h
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2023 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#pragma once
6
12
#include <memory>
13
14
namespace
Freestyle
{
15
16
template
<
typename
T>
class
AutoPtr
:
public
std::unique_ptr<T> {
17
public
:
18
using
std::unique_ptr<T>::unique_ptr;
19
20
AutoPtr
() : std::unique_ptr<T>() {}
21
AutoPtr
(T *
ptr
) : std::unique_ptr<T>(
ptr
) {}
22
23
/* Mimic behavior of legacy auto_ptr.
24
* Keep implementation as small as possible, hens delete assignment operator. */
25
26
template
<
typename
X>
AutoPtr
(
AutoPtr<X>
&other) : std::unique_ptr<T>(other.get())
27
{
28
other.release();
29
}
30
31
using
std::unique_ptr<T>::operator=;
32
33
template
<
typename
X>
AutoPtr
&
operator=
(
AutoPtr<X>
&other) =
delete
;
34
};
35
36
}
/* namespace Freestyle */
Freestyle::AutoPtr
Definition
AutoPtrHelper.h:16
Freestyle::AutoPtr::AutoPtr
AutoPtr(AutoPtr< X > &other)
Definition
AutoPtrHelper.h:26
Freestyle::AutoPtr::AutoPtr
AutoPtr(T *ptr)
Definition
AutoPtrHelper.h:21
Freestyle::AutoPtr::AutoPtr
AutoPtr()
Definition
AutoPtrHelper.h:20
Freestyle::AutoPtr::operator=
AutoPtr & operator=(AutoPtr< X > &other)=delete
Freestyle
inherits from class Rep
Definition
AppCanvas.cpp:20
ptr
PointerRNA * ptr
Definition
wm_files.cc:4126
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0