我的类中的一个函数将枚举作为参数:
// Foobar.h
class Foobar
{
void baz(OtherClass::OtherEnum otherEnum);
}
通常为了编译这个类,我必须包含OtherClass.
#include "OtherClass.h"
但是,OtherClass它确实很大,我不想将它包含在Foobar's header 中,否则它会污染使用Foobar.
是否仍然可以在OtherEnum不包含的情况下作为参数传递OtherClass.h?