@@ -105,7 +105,7 @@ def erase_allocator(self, cls_name, default_allocator='std::allocator'):
105105 return
106106 value_type = c_args [0 ]
107107 tmpl = string .Template (
108- "$container< $value_type, $allocator<$value_type> >" )
108+ "$container<$value_type, $allocator<$value_type>>" )
109109 tmpl = tmpl .substitute (
110110 container = c_name ,
111111 value_type = value_type ,
@@ -122,11 +122,10 @@ def erase_container(self, cls_name, default_container_name='std::deque'):
122122 return
123123 value_type = c_args [0 ]
124124 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 (
126126 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 )])
130129
131130 def erase_container_compare (
132131 self ,
@@ -159,8 +158,8 @@ def erase_compare_allocator(
159158 return
160159 value_type = c_args [0 ]
161160 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>>" )
164163 tmpl = tmpl .substitute (
165164 container = c_name ,
166165 value_type = value_type ,
@@ -184,14 +183,14 @@ def erase_map_compare_allocator(
184183 mapped_type = c_args [1 ]
185184 tmpls = [
186185 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>> >" ),
189188 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>> >" ),
192191 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>> >" )]
195194 for tmpl in tmpls :
196195 tmpl = tmpl .substitute (
197196 container = c_name ,
@@ -218,13 +217,13 @@ def erase_hash_allocator(self, cls_name):
218217 if len (c_args ) == 3 :
219218 default_hash = 'hash_compare'
220219 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>>" )
223222 elif len (c_args ) == 4 :
224223 default_hash = 'hash'
225224 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>>" )
228227 else :
229228 return
230229
@@ -263,14 +262,14 @@ def erase_hashmap_compare_allocator(self, cls_name):
263262 if len (c_args ) == 4 :
264263 default_hash = 'hash_compare'
265264 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>> >" )
269268 if key_type .startswith ('const ' ) or key_type .endswith (' const' ):
270269 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>> >" )
274273 elif len (c_args ) == 5 :
275274 default_hash = 'hash'
276275 if self .unordered_maps_and_sets :
@@ -279,31 +278,31 @@ def erase_hashmap_compare_allocator(self, cls_name):
279278 "$hash<$key_type>, " +
280279 "$equal_to<$key_type>, " +
281280 "$allocator<std::pair<const$key_type, " +
282- "$mapped_type> > >" )
281+ "$mapped_type>> >" )
283282 if key_type .startswith ('const ' ) or \
284283 key_type .endswith (' const' ):
285284 tmpl = string .Template (
286285 "$container<$key_type, $mapped_type, " +
287- "$hash<$key_type >, " +
288- "$equal_to<$key_type >, " +
286+ "$hash<$key_type>, " +
287+ "$equal_to<$key_type>, " +
289288 "$allocator<std::pair<$key_type, " +
290- "$mapped_type> > >" )
289+ "$mapped_type>> >" )
291290 else :
292291 tmpl = string .Template (
293- "$container< $key_type, $mapped_type, "
292+ "$container<$key_type, $mapped_type, "
294293 "$hash<$key_type >, " +
295294 "$equal_to<$key_type>, "
296- "$allocator< $mapped_type> >" )
295+ "$allocator<$mapped_type>>" )
297296 if key_type .startswith ('const ' ) or \
298297 key_type .endswith (' const' ):
299298 # TODO: this template is the same than above.
300299 # Make sure why this was needed and if this is
301300 # tested. There may be a const missing somewhere.
302301 tmpl = string .Template (
303- "$container< $key_type, $mapped_type, " +
304- "$hash<$key_type >, " +
302+ "$container<$key_type, $mapped_type, " +
303+ "$hash<$key_type>, " +
305304 "$equal_to<$key_type>, " +
306- "$allocator< $mapped_type > >" )
305+ "$allocator<$mapped_type> >" )
307306 else :
308307 return
309308
0 commit comments