Rumbleball
(Rumbleball)
November 22, 2018, 10:45am
111
Justin.Dooley:
Well having any circular reference should be avoided. It can work but is not optimal. A few things that can go wrong is:
You can’t use static linking
cant use dependency injection
Can cause simple recursive algorithms to crash. (serialization might have this issue in UE4 I haven’t dug too deep into it)
If you do have a working circular reference and you need to recompile a class it increases compile time because it forces you to recompile both classes
They are generally confusing when debugging.
Essentially just avoid them if you can and the benefits speak for themselves. I remember Epic was battling Blueprint circular links back around 4.12 or something. Might want to look into what they did there.
You are talking about C++? I was talking about Blueprint. Dunno if thats a difference in this case. C++ should not compile at all if there is a circular dependency in headers.