PJ unnecessary header include in PluginEditor.h

PluginEditor.h doesn’t need to

#include "PluginProcessor.h"

It’s included in the implementation file.


Wouldn’t this be the other way around, just removing the #include from PluginEditor.cpp? PluginEditor.h generates with a processor reference member in the class declaration, so it directly needs the #include

Well if it were me, I’d use a forward declaration in the header:

 class MyAudioProcessor;

and in the implementation file reverse the header order…

#include "PluginEditor.h"
#include "PluginProcessor.h"

That would potentialy speed up compilation time (very) slightly.



I agree, apart from the speedup it sets a good example for users who see it. I’ve learned a lot about C++ by reading other people’s code and being like “Oh, nice. I didn’t know you could do that.”