Blender
V3.3
source
blender
freestyle
intern
view_map
AutoPtrHelper.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3
#pragma once
4
10
#include <memory>
11
12
namespace
Freestyle
{
13
14
template
<
typename
T>
class
AutoPtr
:
public
std::unique_ptr<T> {
15
public
:
16
using
std::unique_ptr<T>::unique_ptr;
17
18
AutoPtr
() :
std
::unique_ptr<
T
>()
19
{
20
}
21
AutoPtr
(
T
*
ptr
) :
std
::unique_ptr<
T
>(
ptr
)
22
{
23
}
24
25
/* Mimic behavior of legacy auto_ptr.
26
* Keep implementation as small as possible, hens delete assignment operator. */
27
28
template
<
typename
X>
AutoPtr
(
AutoPtr<X>
&other) :
std
::unique_ptr<
T
>(other.get())
29
{
30
other.release();
31
}
32
33
using
std::unique_ptr<T>::operator=;
34
35
template
<
typename
X>
AutoPtr
&
operator=
(
AutoPtr<X>
&other) =
delete
;
36
};
37
38
}
/* namespace Freestyle */
Freestyle::AutoPtr
Definition:
AutoPtrHelper.h:14
Freestyle::AutoPtr::AutoPtr
AutoPtr(AutoPtr< X > &other)
Definition:
AutoPtrHelper.h:28
Freestyle::AutoPtr::AutoPtr
AutoPtr(T *ptr)
Definition:
AutoPtrHelper.h:21
Freestyle::AutoPtr::operator=
AutoPtr & operator=(AutoPtr< X > &other)=delete
Freestyle::AutoPtr::AutoPtr
AutoPtr()
Definition:
AutoPtrHelper.h:18
T
#define T
Definition:
mball_tessellate.c:264
Freestyle
inherits from class Rep
Definition:
AppCanvas.cpp:18
std
Definition:
cycles_cubin_cc.cpp:22
ptr
PointerRNA * ptr
Definition:
wm_files.c:3480
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1