Sorry, my dog’s been sick this week so it’s been a bit hard to get much done when I’ve had to get her out every hour or so. She seems to be doing better now, though
Yep, operator overloading is definitely doable. Generally, it’s recommended to use the feature sparingly to help keep things from getting too confusing. BOSS, for example, uses operator overloading to simply define a template for its log file. It does so by overloading the stream operator << and replacing it with << template to make things cleaner.
We can also overload the ( and ) to change the order of operations if we want. That’s a bit of a more esoteric change but it can definitely be done. Why we’d do so is anyone’s guess 😛
If we were to overload things, how would we use them?
Edit:
Found the lines that create the arrays (I think, will need to verify later):
/* Static array for creating the record's subrecords */
#define DECLARE_SUBRECCREATE() private: \
static const esmsubreccreate_t s_SubRecCreate[]; \
virtual const esmsubreccreate_t* GetSubRecCreate (void) const { return (s_SubRecCreate); }
They’re in esm/EsmRecord.h
Going to leave it alone for now but it definitely could use some sweeping.
So that macro is used to insert those lines into certain classes. Two better options would be to add it to the base class so they’re inherited or simply copy them into the child classes. It’s important not to do it via a macro so that we understand what’s going on in each class.
