Return an iterator over the list of template arguments in a C++ type
string.
>>> t = 'map<string, vector<int, allocator<int> >, allocator<v<i>, a<i>> >'
>>> list(extract_template_args(t))
['string', 'vector<int, allocator<int> >', 'allocator<v<i>, a<i>>']
>>> list(extract_template_args('int'))
[]
Definition at line 206 of file semantics.py.
208 Return an iterator over the list of template arguments in a C++ type 211 >>> t = 'map<string, vector<int, allocator<int> >, allocator<v<i>, a<i>> >' 212 >>> list(extract_template_args(t)) 213 ['string', 'vector<int, allocator<int> >', 'allocator<v<i>, a<i>>'] 214 >>> list(extract_template_args('int')) 219 for p, c
in enumerate(cpp_type):
221 if template_level == 1:
222 yield cpp_type[arg_start:p].strip()
226 if template_level == 1:
230 if template_level == 0:
231 yield cpp_type[arg_start:p].strip()
def extract_template_args(cpp_type)