File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -77,8 +77,6 @@ namespace s3d
77
77
SIV3D_NODISCARD_CXX20
78
78
ConstantBuffer (const Type& data);
79
79
80
- ~ConstantBuffer ();
81
-
82
80
ConstantBuffer& operator =(const Type& data);
83
81
84
82
[[nodiscard]]
@@ -117,7 +115,15 @@ namespace s3d
117
115
118
116
ConstantBufferBase m_base;
119
117
120
- WrapperType* const m_wrapper = AlignedNew<WrapperType>();
118
+ struct Deleter
119
+ {
120
+ void operator ()(WrapperType* p) const
121
+ {
122
+ AlignedDelete<WrapperType>(p);
123
+ }
124
+ };
125
+
126
+ std::unique_ptr<WrapperType, Deleter> m_wrapper{ AlignedNew<WrapperType>() };
121
127
122
128
bool m_hasDirty = true ;
123
129
};
Original file line number Diff line number Diff line change @@ -24,12 +24,6 @@ namespace s3d
24
24
m_wrapper->data = data;
25
25
}
26
26
27
- template <class Type >
28
- inline ConstantBuffer<Type>::~ConstantBuffer ()
29
- {
30
- AlignedDelete (m_wrapper);
31
- }
32
-
33
27
template <class Type >
34
28
inline ConstantBuffer<Type>& ConstantBuffer<Type>::operator =(const Type& data)
35
29
{
You can’t perform that action at this time.
0 commit comments