skyrim-multiplayer / skymp

Multiplayer Mod & TypeScript SDK for Skyrim Special Edition
Other
221 stars 75 forks source link

Determine type of espm record automatically #334

Closed Pospelove closed 2 years ago

Pospelove commented 3 years ago

In skymp5-server/cpp/lib_espm/espm.h:

class WEAP : public RecordHeader
{
public:
  static constexpr auto type = "WEAP";

Currently, we need to write record type names twice: as a class name and as a const string. We need to determine static constexpr auto type automatically.

Useful links: https://github.com/Neargye/nameof https://stackoverflow.com/questions/1666802/is-there-a-class-macro-in-c

Pospelove commented 2 years ago

no activity. closing