Remove unused includes from C++ code

… in very controlled scenarios.

There’s a surprising lack of decent c++ linters, and I definitely would not 100% trust Rider’s “unused include” notification – there’s a reason why C++ Linters don’t seem to incorporate that function, and I don’t know for sure, but I’d suspect that it’s a task that is more difficult than it seems. So if you remove an include at it’s advice, make sure you full build afterwards to make sure you didn’t break anything. Sometimes when you remove that header that isn’t used in file A, it’s also no longer available when file B builds, so you end up needing it in a different file now.

1 Like