#inheritance of types

7 messages · Page 1 of 1 (latest)

exotic fossil
#

1-st image - work fine
2-nd image - doesn't work
If structures and classes (in my case) divided with own .hpp files - doesnt work, if not (all in onee) its working fine. Please, explain why. Thank you very much!

foggy skiffBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

exotic fossil
#

error:

#

implementation

abstract python
#

In the second version, it doesn't know the PlayerObjectData is a subclass of ObjectData, so it can't allow the mismatch return types of virtual methods

#

You can't forward declare a class along with its inheritance.
Best option is probably just to include struct.hpp inside object hpp

exotic fossil
#

@abstract python thank a lot!