I am using an external library named custom (not the actual name) which defines many of its data types in its own namespace. Let's assume that the namespace is named as custom
as well.
I am trying to make use of a datatype named DataType
. DataType
is a custom type defined using a typedef, and let's assume that it can be used in a .cpp file by including "custom/datatype.h"
My code has the following setting.
action.h:
class Action
{
Action() {}
virtual ~Action() {}
virtual void foo(custom::DataType*) const = 0;
...
}
some_action.h:
#include "action.h"
class SomeAction : public Action
{
SomeAction() {}
virtual void foo(custom::DataType*) const override;
...
}
some_action.cpp:
#include "some_action.h"
#include "custom/datatype.h"
...
void SomeAction::foo(custom::DataType*) const
{
...
}
Is there any proper way to forward-declare DataType
in action.h
and some_action.h
other than including "custom/datatype.h"
in action.h
?