@@ -104,27 +104,6 @@ Class::Class(const Cursor &cursor, const Namespace ¤tNamespace)
104
104
}
105
105
}
106
106
107
- Class::~Class (void )
108
- {
109
- for (auto *baseClass : m_baseClasses)
110
- delete baseClass;
111
-
112
- for (auto *constructor : m_constructors)
113
- delete constructor;
114
-
115
- for (auto *field : m_fields)
116
- delete field;
117
-
118
- for (auto *staticField : m_staticFields)
119
- delete staticField;
120
-
121
- for (auto *method : m_methods)
122
- delete method;
123
-
124
- for (auto *staticMethod : m_staticMethods)
125
- delete staticMethod;
126
- }
127
-
128
107
bool Class::ShouldCompile (void ) const
129
108
{
130
109
return isAccessible ( ) && !isNativeType ( m_qualifiedName );
@@ -152,7 +131,7 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
152
131
153
132
int i = 0 ;
154
133
155
- for (auto * baseClass : m_baseClasses)
134
+ for (auto & baseClass : m_baseClasses)
156
135
{
157
136
// ignore native types
158
137
if (isNativeType ( baseClass->name ))
@@ -181,12 +160,11 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
181
160
{
182
161
TemplateData constructors { TemplateData::Type::List };
183
162
184
- for (auto * ctor : m_constructors)
163
+ for (auto & ctor : m_constructors)
185
164
{
186
165
if (ctor->ShouldCompile ( ))
187
166
constructors << ctor->CompileTemplate ( context );
188
167
}
189
-
190
168
191
169
data[ " constructor" ] = constructors;
192
170
data[ " dynamicConstructor" ] = constructors;
@@ -196,7 +174,7 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
196
174
{
197
175
TemplateData fields { TemplateData::Type::List };
198
176
199
- for (auto * field : m_fields)
177
+ for (auto & field : m_fields)
200
178
{
201
179
if (field->ShouldCompile ( ))
202
180
fields << field->CompileTemplate ( context );
@@ -209,7 +187,7 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
209
187
{
210
188
TemplateData staticFields { TemplateData::Type::List };
211
189
212
- for (auto * staticField : m_staticFields)
190
+ for (auto & staticField : m_staticFields)
213
191
{
214
192
if (staticField->ShouldCompile ( ))
215
193
staticFields << staticField->CompileTemplate ( context );
@@ -222,7 +200,7 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
222
200
{
223
201
TemplateData methods { TemplateData::Type::List };
224
202
225
- for (auto * method : m_methods)
203
+ for (auto & method : m_methods)
226
204
{
227
205
if (method->ShouldCompile ( ))
228
206
methods << method->CompileTemplate ( context );
@@ -235,7 +213,7 @@ TemplateData Class::CompileTemplate(const ReflectionParser *context) const
235
213
{
236
214
TemplateData staticMethods { TemplateData::Type::List };
237
215
238
- for (auto * staticMethod : m_staticMethods)
216
+ for (auto & staticMethod : m_staticMethods)
239
217
{
240
218
if (staticMethod->ShouldCompile ( ))
241
219
staticMethods << staticMethod->CompileTemplate ( context );
0 commit comments