@@ -105,7 +105,7 @@ def erase_allocator(self, cls_name, default_allocator='std::allocator'):
105
105
return
106
106
value_type = c_args [0 ]
107
107
tmpl = string .Template (
108
- "$container< $value_type, $allocator<$value_type> >" )
108
+ "$container<$value_type, $allocator<$value_type>>" )
109
109
tmpl = tmpl .substitute (
110
110
container = c_name ,
111
111
value_type = value_type ,
@@ -122,11 +122,10 @@ def erase_container(self, cls_name, default_container_name='std::deque'):
122
122
return
123
123
value_type = c_args [0 ]
124
124
dc_no_defaults = self .erase_recursive (c_args [1 ])
125
- if self .normalize (dc_no_defaults ) ! = self .normalize (
125
+ if self .normalize (dc_no_defaults ) = = self .normalize (
126
126
templates .join (default_container_name , [value_type ])):
127
- return
128
- return templates .join (
129
- c_name , [self .erase_recursive (value_type )])
127
+ return templates .join (
128
+ c_name , [self .erase_recursive (value_type )])
130
129
131
130
def erase_container_compare (
132
131
self ,
@@ -159,8 +158,8 @@ def erase_compare_allocator(
159
158
return
160
159
value_type = c_args [0 ]
161
160
tmpl = string .Template (
162
- "$container< $value_type, $compare<$value_type>, " +
163
- "$allocator<$value_type> >" )
161
+ "$container<$value_type, $compare<$value_type>, " +
162
+ "$allocator<$value_type>>" )
164
163
tmpl = tmpl .substitute (
165
164
container = c_name ,
166
165
value_type = value_type ,
@@ -184,14 +183,14 @@ def erase_map_compare_allocator(
184
183
mapped_type = c_args [1 ]
185
184
tmpls = [
186
185
string .Template (
187
- "$container< $key_type, $mapped_type, $compare<$key_type>, " +
188
- "$allocator< std::pair< const $key_type, $mapped_type> > >" ),
186
+ "$container<$key_type, $mapped_type, $compare<$key_type>, " +
187
+ "$allocator<std::pair<const $key_type, $mapped_type>> >" ),
189
188
string .Template (
190
- "$container< $key_type, $mapped_type, $compare<$key_type>, " +
191
- "$allocator< std::pair< $key_type const, $mapped_type> > >" ),
189
+ "$container<$key_type, $mapped_type, $compare<$key_type>, " +
190
+ "$allocator<std::pair< $key_type const, $mapped_type>> >" ),
192
191
string .Template (
193
- "$container< $key_type, $mapped_type, $compare<$key_type>, " +
194
- "$allocator< std::pair< $key_type, $mapped_type> > >" )]
192
+ "$container<$key_type, $mapped_type, $compare<$key_type>, " +
193
+ "$allocator<std::pair<$key_type, $mapped_type>> >" )]
195
194
for tmpl in tmpls :
196
195
tmpl = tmpl .substitute (
197
196
container = c_name ,
@@ -218,13 +217,13 @@ def erase_hash_allocator(self, cls_name):
218
217
if len (c_args ) == 3 :
219
218
default_hash = 'hash_compare'
220
219
tmpl = (
221
- "$container< $value_type, $hash<$value_type, " +
222
- "$less<$value_type> >, $allocator<$value_type> >" )
220
+ "$container<$value_type, $hash<$value_type, " +
221
+ "$less<$value_type>>, $allocator<$value_type>>" )
223
222
elif len (c_args ) == 4 :
224
223
default_hash = 'hash'
225
224
tmpl = (
226
- "$container< $value_type, $hash<$value_type >, " +
227
- "$equal_to<$value_type >, $allocator<$value_type> >" )
225
+ "$container<$value_type, $hash<$value_type>, " +
226
+ "$equal_to<$value_type>, $allocator<$value_type>>" )
228
227
else :
229
228
return
230
229
@@ -263,14 +262,14 @@ def erase_hashmap_compare_allocator(self, cls_name):
263
262
if len (c_args ) == 4 :
264
263
default_hash = 'hash_compare'
265
264
tmpl = string .Template (
266
- "$container< $key_type, $mapped_type, " +
267
- "$hash<$key_type, $less<$key_type> >, " +
268
- "$allocator< std::pair< const $key_type, $mapped_type> > >" )
265
+ "$container<$key_type, $mapped_type, " +
266
+ "$hash<$key_type, $less<$key_type>>, " +
267
+ "$allocator<std::pair<const $key_type, $mapped_type>> >" )
269
268
if key_type .startswith ('const ' ) or key_type .endswith (' const' ):
270
269
tmpl = string .Template (
271
- "$container< $key_type, $mapped_type, $hash<$key_type, " +
272
- "$less<$key_type> >, $allocator< std::pair< $key_type, " +
273
- "$mapped_type> > >" )
270
+ "$container<$key_type, $mapped_type, $hash<$key_type, " +
271
+ "$less<$key_type>>, $allocator<std::pair<$key_type, " +
272
+ "$mapped_type>> >" )
274
273
elif len (c_args ) == 5 :
275
274
default_hash = 'hash'
276
275
if self .unordered_maps_and_sets :
@@ -279,31 +278,31 @@ def erase_hashmap_compare_allocator(self, cls_name):
279
278
"$hash<$key_type>, " +
280
279
"$equal_to<$key_type>, " +
281
280
"$allocator<std::pair<const$key_type, " +
282
- "$mapped_type> > >" )
281
+ "$mapped_type>> >" )
283
282
if key_type .startswith ('const ' ) or \
284
283
key_type .endswith (' const' ):
285
284
tmpl = string .Template (
286
285
"$container<$key_type, $mapped_type, " +
287
- "$hash<$key_type >, " +
288
- "$equal_to<$key_type >, " +
286
+ "$hash<$key_type>, " +
287
+ "$equal_to<$key_type>, " +
289
288
"$allocator<std::pair<$key_type, " +
290
- "$mapped_type> > >" )
289
+ "$mapped_type>> >" )
291
290
else :
292
291
tmpl = string .Template (
293
- "$container< $key_type, $mapped_type, "
292
+ "$container<$key_type, $mapped_type, "
294
293
"$hash<$key_type >, " +
295
294
"$equal_to<$key_type>, "
296
- "$allocator< $mapped_type> >" )
295
+ "$allocator<$mapped_type>>" )
297
296
if key_type .startswith ('const ' ) or \
298
297
key_type .endswith (' const' ):
299
298
# TODO: this template is the same than above.
300
299
# Make sure why this was needed and if this is
301
300
# tested. There may be a const missing somewhere.
302
301
tmpl = string .Template (
303
- "$container< $key_type, $mapped_type, " +
304
- "$hash<$key_type >, " +
302
+ "$container<$key_type, $mapped_type, " +
303
+ "$hash<$key_type>, " +
305
304
"$equal_to<$key_type>, " +
306
- "$allocator< $mapped_type > >" )
305
+ "$allocator<$mapped_type> >" )
307
306
else :
308
307
return
309
308
0 commit comments