Given the follow STL error:
./poly_power/poly_class.cpp:496: error: no matching function for call to ‘state_operator< polynomial< variable_term< polynomial< variable_term< std::basic_string<char, std::char_traits< char>, std::allocator< char> >, int> >, polynomial< variable_term<std::basic_string< char, std::char_traits< char>, std::allocator<char> >, int> > > >, polynomial<variable_term< polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> >, polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> > > > >::operation( std::pair< const std::basic_string< char, std::char_traits< char>, std::allocator< char> >, state_vector_term< polynomial< variable_term< polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> >, polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> > > >, polynomial< variable_term< polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> >, polynomial< variable_term< std::basic_string< char, std::char_traits< char>, std::allocator< char> >, int> > > > > >&)’
how can I use a reg-ex expression to simplify it to something that looks like:
./poly_power/poly_class.cpp:496: error: no matching function for call to ‘state_operator<...>::operation( std::pair<...>&)’
ie. Convert everything within the outer pair of <>
into ...
. I am aware of STLFilt, a perl script that does something similar, but I think it would be pedagogic to see how this could be done in pure regex.
Bonus
Paraitimze the expression so that it works on the nth level of <>
. The 1st level would be example above, while the 2nd level would show something like state_operator<polynomial<...>, polynomial<...> >
.