Packages
Packages copied to clipboard
[C++] Pointer type as template parameter breaks syntax highlighting
I'm not sure if this is a bug or it's intended behavior but taking this code:
void foo()
{
std::copy(first, last, std::ostream_iterator<T>(std::cout, "\n"));
}
when T
is not a pointer type, std::ostream_iterator
is highlighted differently from when T
is a pointer type.
This is what it looks like when T
is not a pointer type:
and this is what it looks like when
T
is a pointer type:
The problem seems to be reproducible with any explicit template instantiation.
This can be fixed by removing '*' from C++.sublime-syntax/variables.regular. And I don't see any side effects of changing this.
This issue applies to references as well (which is rarer though), but fixing that is more complicated.