-
Notifications
You must be signed in to change notification settings - Fork 23
Incomplete type reflection
Julien SOYSOUVANH edited this page Oct 24, 2021
·
1 revision
To reduce compilation time, it is common to forward declare classes and only use pointer / references in the header file. Refureku supports it, but you must ensure that the generated source file is included AFTER all forward declared types have been included:
//ExampleClass.h
#pragma once
#include "Generated/ExampleClass.rfkh.h"
class ForwardDeclaredType;
class CLASS() ExampleClass
{
FIELD()
ForwardDeclaredType* field;
METHOD()
void method(ForwardDeclaredType*);
ExampleClass_GENERATED
};
File_ExampleClass_GENERATED
//ExampleClass.cpp
//Include all forward declared type headers before including the generated source file
#include "ForwardDeclaredType.h"
#include "Generated/ExampleClass.rfks.h"