1

One of the functions in my class takes an enum as a parameter:

// Foobar.h
class Foobar
{
    void baz(OtherClass::OtherEnum otherEnum);
}

Normally in order to get this class to compile, I would have to include the header for OtherClass.

#include "OtherClass.h"

However, OtherClass happens to be really big, and I don't want to include it in Foobar's header or it will pollute the compilation unit of everything else that uses Foobar.

Is it possible to still pass OtherEnum as a parameter without including OtherClass.h?

Cory Klein
  • 51,188
  • 43
  • 183
  • 243

0 Answers0