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