I'm using set matchpairs+=<:> with my C++ code, and it works great. But there are some cases where it is not quite there, like this C++ code:
#include <type_traits>
template<int X> typename std::enable_if<(X>9),int>::type func() { return 5; }
int main() { func<10>(); }
Here, if you put the cursor on the < after enable_if, the > in X>9 will be highlighted. Of course it makes sense from the perspective of Vim, which isn't a C++ compiler nor an IDE. But is there any easy way to make it not match pairs broken by non-closed parentheses? I.e. I'd like <()> to match the closing angle bracket, and <(>) not to.